SQL & PL/SQL :: Showing Leading Zeroes In XML?

Sep 15, 2011

I am generating an XML file from plsql using utl_file.There is a problem in number field.The value in the table is 0.18 and it is showing up in xml as .18. The leading zero is not showing up.

COLUMN_NAME is number (15);

<TAG>' || A.COLUMN_NAME || '</TAG>

I have tried using to_char(), but it is still showing up as .18 in XML. I want it as 0.18 in XML as well.

View 1 Replies


ADVERTISEMENT

Client Tools :: Leading Zeroes Are Getting Wiped Off When Results Are Copied Into Excel

Apr 13, 2012

We wrote a query to spool the results in TAB delimited flat file, Results are ok but when copied into excel the leading zeroes are getting wiped off.

Example:

Result: 0000123 and when copied into excel the value is just 123. I need to retain the value as it is 0000123.

Can we control it in the query itself rather than correcting the excel.

View 4 Replies View Related

SQL & PL/SQL :: Remove Only One Leading 0?

Jun 3, 2010

I receive source data with leading zeros. The Rules says: "If there is a leading 0 it has to be removed and data has to be shown starting with character 2".Here is my code I started with:

CREATE TABLE leading_0_test
(
col_1 VARCHAR2(10)
)

insert into leading_0_test values('00123')
select trim(leading'0' from COL_1),trim(leading'0' from substr(COL_1,1,1)),COL_1 from leading_0_test

The first trim removes all leading zeros. Therefore I tried to solve it with the substr, but without success.

View 7 Replies View Related

How To Replace Leading Wildcards

Jan 16, 2011

So many of the queries in our database query by an account but an account is allowed to vary by prefix and so queries are written similar to account like '%suffix'

Our DBA has rejected the use of context indexes and friends to deal with this.

as an aside and I'm probably going to regret going into this much detail but our model is

A->>B->>C

typically the queries want to fetch C's for a customer defined by A.account

A, B, C are all partitioned with partition key created_date

however, only C is typically queried with created_date as a qualifier. A and B are related by joins from A->>B and B->>C

when queries are written to use '%' leading wildcards often it results in a full table scan across multiple partitions. on any given day all we care about are the most recent C's for the customer where customer is defined by A.account.

I recently had an idea whereby fields such as A.Account could also be kept(denormalized) in the C table

the idea is if the queries were written to use C.account like '%bla' instead of A.account like '%bla' then because C is always qualified with the partition key ie. C.created_date that would at worst result in a full partition scan only. this is considerably less expensive than doing a full table scan of A. The IO cost of doing that is huge.

populating the C.account is a simple before insert or update trigger. when you insert a C you have a foreign key to a B and B has a foreign key to A. A and B are always created before any C is seen for any given C. When a C is seen A and B already exist in the database.

View 3 Replies View Related

Performance Tuning :: Index Leading Columns?

Dec 14, 2010

I have been reading Oracle documentaion about access paths, got strucked at the concept 'Leading columns in index'. what is meant by 'Leading columns of an index', how to find/judge them that they are leading columns.

The url where I am reading is[URL]...

View 4 Replies View Related

SQL & PL/SQL :: Removing Leading Single Quote In Excel File?

Feb 20, 2013

This package is generating excel file which contains cursor result.In excel data is populated like below.Column name is Zip_code .My concern is how to remove that single quote from excel file.

eg:

Zip_
'01234
'12567
'23432
'00234

create or replace
PACKAGE BODY PKG_MONTH_END_AUTOMATION AS
PROCEDURE PROC_ZIP_CODE_MONTHEND (directoryOrPath IN VARCHAR2 default 'LOC_PHASE1_WHOUSE_SALES_ADMIN')

[code]...

-- main body

BEGIN
-- Generating Zip Files
SELECT last_day(add_months(sysdate,-1))
INTO v_last_date

[code]...

View 6 Replies View Related

SQL & PL/SQL :: Time Not Showing

Jan 24, 2012

I have a field " Tran_date with data type Date . This field contains date as well as time both . while I run this query :

select to_char(tran_date,'DD-MON-YYYY HH24:MI:SS') from ABC
WHERE lOC='1' ;

It is showing result :

21-JAN-2012 00:00:00

Why it is showing 00:00:00 although there is time like 08:25:12 Where is the problem ? Why I can'y see time . I need to change anything ,anywhere ?

View 9 Replies View Related

SQL & PL/SQL :: Showing Rows As A Matrix

Sep 15, 2010

I want a sql query to transform my output..Also number of rows are not limited

Current Output

Col_A
1
2
3
4
5
6
7
8
9
10

however i need data as

COL_A COL_BCOL_C COL_D
1 2 3 4
5 6 7 8

View 6 Replies View Related

SQL & PL/SQL :: Showing Monthly Data

Mar 6, 2013

I am having the query

SELECT JOB,
decode(to_char(hiredate,'YY'),80,to_char(hiredate,'MON'),NULL) "80",
decode(to_char(hiredate,'YY'),81,to_char(hiredate,'MON'),NULL) "81",
decode(to_char(hiredate,'YY'),82,to_char(hiredate,'MON'),NULL) "82",
decode(to_char(hiredate,'YY'),83,to_char(hiredate,'MON'),NULL) "83",
count(*) total
FROM emp
WHERE JOB='CLERK'
GROUP BY JOB,
hiredate;

I want result as follows

job 80 81 82 83 TOTAL
CLERK DEC DEC 2
CLERK JAN JAN 2

That means if 80,81,82,83 if having some common month then it should show side by side.

View 20 Replies View Related

SQL & PL/SQL :: Trigger Is Showing Bad Variable?

Nov 23, 2012

When i am compiling trigger with only "after update", trigger is running fast. But when i am running with "After insert or update or delete" event on trigger, trigger comes with compilation error.

SQL> drop trigger trg_stk_upd_pur;
Trigger dropped.
SQL> create or replace trigger trg_stk_upd_pur
2 after update on O_STOCK_EFFECTS
3 REFERENCING NEW AS new OLD AS old
4 FOR EACH ROW
5 begin
6 prc_stk_upd_pur(:old.seff_comp_suid, :old.seff_area_suid, :old.seff_tran_suid);
7 end;
8 /

[code].....

Warning: Trigger created with compilation errors.

SQL> sho err
Errors for TRIGGER TRG_STK_UPD_PUR:
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/23 PLS-00049: bad bind variable 'OLD.SEFF_COMP_SUID'
3/44 PLS-00049: bad bind variable 'OLD.SEFF_AREA_SUID'
3/65 PLS-00049: bad bind variable 'OLD.SEFF_TRAN_SUID'

[code].....

View 2 Replies View Related

Reg - Handle Not Showing Alias Name?

Oct 1, 2012

My OTN account handle shows the number but till yesterday it was showing the Alias Name "ranit B".

Handle:      912545
Email:      
Status Level:      Newbie (20)
Registered:      Feb 6, 2012

[code]...

View 13 Replies View Related

PL/SQL :: Number Not Showing Zero After Decimal

Feb 21, 2013

i have a column

NUMBER(13,4)

when i insert 234.000

in show only 234

where as when i insert 234.12

i shows 234.12

is there any setting by which i can show 234.0000

View 13 Replies View Related

Sysdate Showing Wrong Timezone?

May 24, 2012

I have one issue My server is in france and it is in french timezone but when I query for sysdate it returns US time.

In '/etc/sysconfig/clock/'
Zone= europe/paris
UTC= true

echo $TZ variable is returning nothing.

sysdate = us time
systimestamp= us time
current_timestamp = french time
current_date = french time
dbtimezone= europe/warsove, sessiontimezone=+2.00( which is also europe timezone offset)
tz_offset(dbtimezone)=+2.00, tz_offset(sessiontimezone)= +2.00 i.e europe
os timezone= europe/paris.

This command "./emctl config agent getTZ" is also returning timezone as europe/paris

Also in "emd.properties" file "agentTZRegion" parameter is set to europe/paris

Oracle version= 11.2.0

Now I don't understand why this sysdate and systimestamp is returning "US time zone" while everything else is returning french time zone.

View 9 Replies View Related

SQL View Showing Non-related Records?

Jun 27, 2011

I'm trying to get a list of values from a table, and I am just not seeing the answer -I have a table with 4 records (say A, B, C, and D), each record has a GUID to uniquely identify it.I have a 2nd table that holds the relationships (parent-child).

At this point, I have 2 rows:
A>B
A>C

So, A is a parent to B, and A is a parent to C (D is not related to anything at this point)

I would like to be able to go into the D record and see that it is NOT related to A (A would be the parent in this instance) - the trick however is I only want 1 instance of A to show up.attempted to use some inner/outer join qualifications and I just cannot seem to get the data to display properly.

View 1 Replies View Related

Forms :: Icons Not Showing On Buttons?

Sep 26, 2012

We are using ERP based on Oracle 10g forms, there is icons on the buttons those icons are displaying when we uses the ERP in Windows based client and browser Internet Explorer.But when we uses Opera browser we are getting ERP but icons are not displaying.

Same way when we uses Linux client machine using Mozilla Firefox there also the icons are not displaying.

View 3 Replies View Related

Why Is OEM SQL Monitoring Showing Parallel On Almost Every Statement

Jan 28, 2013

I'm running Oracle EE 11.2.0.2 and when I look in OEM SQL Monitoring, it shows nearly every sql statement running with a degree of parallelism of *2*.

I've checked dba_tables and the 'degree' for all tables is only 1. I look at the actual sql statement, and there are no hints to tell it to use parallelism. So why and how is the database using parallelism?

I do see that parallel_threads_per_cpu is set to 2, but this is default for our Solaris 10 operating system.

REF: (for 11.2)
===========
PARALLEL_THREADS_PER_CPU specifies the default degree of parallelism for the instance and determines the parallel adaptive and load balancing algorithms. The parameter describes the number of parallel execution processes or threads that a CPU can handle during parallel execution.

The default is platform-dependent and is adequate in most cases. You should decrease the value of this parameter if the machine appears to be overloaded when a representative parallel query is executed. You should increase the value if the system is I/O bound.

how to tell if my database is actually IO bound or not?

View 6 Replies View Related

Forms :: Display Item Not Showing Result?

Oct 8, 2010

am facing a Problem in creating display items .First I create a display item and name it ITEM6This Display item will show Department name of employees .I create a Block Level Trigger to invoke this display item .

WHEN-VALIDATE-ITEM
select dname into :ITEM6 FROM DEPT where :EMP.DEPTNO=DEPT.DEPTNO;

In Property Palette I edit following
Data Type : char
canvas :canvas4

Then I save ,compile and Run it successfully .But when i press Execute Query button . It shows me Following error message .

SELECT ROWID,ITEM6,EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO FROM scott.emp

ORA-00904: "ITEM6": invalid identifier

View 2 Replies View Related

Forms :: Showing Message When Canvas Changing?

Jan 6, 2012

I am facing one confusion with canvas changing and message displaying issue i have one login page. in that there are three fields username,password and department in the department i having 5 departments including salesandmarketing

the requirement once i entered every credentials correctly and i am logging in as salesandmarketing. When the salesandmarketing canvas opens a message should display saying "you are successfully entered into sales and marketing".

i have my home page as content canvas and sales and marketing as tab canvasi need to do the same message when i am entering into 5 departments with corresponding department name in the message end instead of salesandmarketing
is it possible to do with when_new_canvas

View 1 Replies View Related

Security :: Select Columns From View - Showing No Value?

Aug 16, 2013

I created a user and granted connect, resource to the user. but trying to select columns from the view USER_HISTORY$,it's showing no value, i tried to login the user several times, but it's displaying no value, any particular reason or any minor mistake?

View 1 Replies View Related

Reports & Discoverer :: View Not Showing All Data?

Nov 1, 2011

We have a view that shows the all the data that we expect, so we created a report to show that data, the report worked, then all of a sudden the report stopped showing all the data. (we did have a server move)I checked the view and the all the data is there....

I have created a new report based on the view but it does the same thing, it doesn't bring all the data up (i get very old data), there are no conditions or anything.

other tables and views seem fine. i have recreated the view and i still have the same problem.

View 2 Replies View Related

Forms :: Vertical Scroll Bar Is Not Showing Properly?

Mar 1, 2010

When I first access the form and query for records, it works as per the expectation and with scroll bar to scroll up and down. But when I do "View>Record>Last", it reaches to last record, but not able to use the scroll bar to scroll the records up(I am on last record, so can't do downward scrolling).

The scroll bar is displaying in Full, no room to scroll up down.It happens only when I do "View>Record>Last".

View 2 Replies View Related

Enterprise Manager :: Not Showing Listener Detail

Nov 4, 2010

we just have create one database server, after installation we change tns port 1521 to 1700, after that we have facing problem in em, so we reconfigure emca and now everything is working fine except one thing, in EM before changing the port it shows LISTENER DETAILS at first page.

But now it doesn't show listener details. see the attach picture. what is the resolution for that problem, how can i get this information on my EM PAGE.

View 1 Replies View Related

Application Express :: Showing A Message From A Button?

May 22, 2013

I have a button with an dynamic action , with sql:

declare
errors varchar2(100);
begin
apex_application.g_print_success_message := 'test message';
errors:=package.function_some_process_returning_varchar100_with_errors_or_sucess;
HTP.p ('<script language="JavaScript"> alert('''||errors||'''); </script>');
end;

The first "test message" is not shown.and after the function (it is executed fine) i get the next error:

Error:Parsererror - SysntaxError: Unexpected token <

i i only leve the first line (g_print_sucess) nothing occurs clicking the button.

I only want to show on a popup the result from the function, but g_print_sucess seems not to work for some reason.

View 1 Replies View Related

Mview Always Showing Status Needing Compile?

Sep 14, 2012

we have a routine which refreshes matrerilized view every day

dbms_mview.refresh('MVIEW_NAME>,'C') refresh ok but in user_ mviews always has status needing compile afterwarsd when compile isfine.

using 11.2.0.3

View 2 Replies View Related

SQL & PL/SQL :: Linking Table Challenge - Showing A Value Only Once Not For Each Match?

May 23, 2012

TABLE 1 : COSTS

I have a table of Costs. We have Jobs that run and there will be a cost associated with a particular machine.So JobNo 1 may run on Machine A and have a cost of 50 dollars. Although its now shown below JobNO 1 could run on MachineB and so on.

JOBNO MACHINE COST
1 MachineA 50
2 MachineA 70
3 MachineA 100

TABLE 2: OPERATIONS

We have operators (PERSONCODE) run the jobs on the machines. So Job 1 may be run by PERSONCODE 8 (e.g. Tony) and it may run on MachineA or MachineB.Multipe people may run a particular job. The PERSONCODE will be unique to the Job and it is actually unique to the list. A person never works on more than one job.

JOBNO MACHINE PERSONCODE
1 MachineA8
1 MachineA7
1 MachineB6
2 MachineA3
2 MachineA2
2 MachineA1
3 MachineA4

DESIRED RESULT:

I need to assign the COSTs to the OPERATIONS table but only want it to show next to one person (next to the appropriate machine).

DESIRED RESULT:

JOBNO MACHINE PERSONCODE COST
1 MachineA8 50
1 MachineA7
1 MachineB6
2 MachineA3 70
2 MachineA2
2 MachineA1
3 MachineA4 100

[code]....

View 5 Replies View Related

Backup & Recovery :: Clone Database Name Not Showing In Dbca

Aug 20, 2012

i have just create a clone database. it work very well.but when i open the dbca to delete this database.it not show in dbca prompt. why ?

View 4 Replies View Related

Networking And Gateways :: NText Columns Not Showing Up In SELECT?

Aug 8, 2013

Our DBA set up a Heterogeneous Service to one of our MS SQL Servers and we can use a DB Link to SELECT a table from the SQL Database. This works just fine but the problem is any nText column on the SQL Database Table doesn't appear. All the columns are shown EXCEPT the nText columns.

how to correct this? We need the ability to select the nText columns also.

View 2 Replies View Related

Reports & Discoverer :: Logo Not Showing In 10g - Paper Layout?

Apr 6, 2013

I have Report in RB 10g , it is showing the logo in PRINT View but when I am running the report in the paper layout it does not showing the logo over there

View 1 Replies View Related

Forms :: Showing Number Of Records Affected (saved)

Jul 31, 2010

We are building a custom form extension with our EBS R12 where against certain parameters we are inserting and updating records in a table through a PL/SQL procedure.This PL/SQL doesn't use a commit exclusively, instead the user must click the Save button after verifying the data (new records are inserted, existing ones are updated and after the insert and update routines, execute_query is fired to fetch the latest data)

Everything works fine, however, when the user clicks on the Save button form status bar says "FRM-40401: No changes to save"

We would like to alter this message with our own custom message stating how many records were inserted and hows many were updated (We have counters counting this information)

Under which particular trigger we should write the code to enhance this requirement?

View 2 Replies View Related

SQL & PL/SQL :: Write A Single Query Showing Number Of Requests

Jan 15, 2011

I need to write a single query showing the number of requests (job_no) in my organization sections (1A,3A,4C,9Z....etc) based on these conditions..Less than 2 months & between 2 and 6 & between 6 and 12month & more than 12 months in my organization sections.

--Table structure

SQL> desc job_transfer
Name
----------------------
JOB_NO (Request number)
IN_SECT (name of entered section)
IN_DATE (date entered the section)
OUT_SECT
OUT_DATE (date went out from section)

I tried using UNION ALL but it didnt work fine.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved