Gap between columns in sql output
Dear all,
We have the below query :
column queue_name format a15
column max_processes format 999
column target_node format a10
column actual_processes format 999
column pending format 999
column running format 999
column onhold format 999
column scheduled format 999
column phase_code format a10
column user_concurrent_program_name format a60
column responsibility_name format a45
column status_code format a15
column requestor format a20
column actual_completion_date format a25
column completion_text format a120
column execution_time_in_minutes format 999999.99
column is_it_scheduled format a15
SELECT request_id,
user_concurrent_program_name|| NVL2(fcrsv.description, ' (' || fcrsv.description || ')', NULL) conc_prog,
fcrsv.requestor
,Case
when fcrsv.requested_start_date > fcrsv.request_date Then 'YES' Else 'NO' End is_it_scheduled
FROM fnd_conc_req_summary_v fcrsv, fnd_responsibility_tl frt
WHERE fcrsv.responsibility_application_id = frt.application_id AND fcrsv.responsibility_id = frt.responsibility_id AND status_code = 'E'
AND actual_start_date > SYSDATE - 1
ORDER BY NVL (actual_start_date, actual_completion_date) DESC;which is displaying the output like below :
REQUEST_ID CONC_PROG REQUESTOR IS_IT_SCHEDULED
32906957 Receipt Import GMOTIS NO
32906857 Receipt Import GMOTIS NO The gap between the column CONC_PROG AND requestor is high , we need to have no normal gap such that the complete output can be seen in
a single screen.
Please advise
Kai
936074 wrote:
Dear all,
We have the below query :
column queue_name format a15
column max_processes format 999
column target_node format a10
column actual_processes format 999
column pending format 999
column running format 999
column onhold format 999
column scheduled format 999
column phase_code format a10
column user_concurrent_program_name format a60
column responsibility_name format a45
column status_code format a15
column requestor format a20
column actual_completion_date format a25
column completion_text format a120
column execution_time_in_minutes format 999999.99
column is_it_scheduled format a15
SELECT request_id,
user_concurrent_program_name|| NVL2(fcrsv.description, ' (' || fcrsv.description || ')', NULL) conc_prog,
fcrsv.requestor
,Case
when fcrsv.requested_start_date > fcrsv.request_date Then 'YES' Else 'NO' End is_it_scheduled
FROM fnd_conc_req_summary_v fcrsv, fnd_responsibility_tl frt
WHERE fcrsv.responsibility_application_id = frt.application_id AND fcrsv.responsibility_id = frt.responsibility_id AND status_code = 'E'
AND actual_start_date > SYSDATE - 1
ORDER BY NVL (actual_start_date, actual_completion_date) DESC;which is displaying the output like below :
REQUEST_ID CONC_PROG REQUESTOR IS_IT_SCHEDULED
32906957 Receipt Import GMOTIS NO
32906857 Receipt Import GMOTIS NO The gap between the column CONC_PROG AND requestor is high , we need to have no normal gap such that the complete output can be seen in
a single screen.
Please advise
Kaiuse RTRIM or LTRIM as appropriate
Similar Messages
-
How to Display Gap between Column in cross tab
Hi,
I have a requirement. I have a cross tab with 4 measures M1, M2, M3, M4. I need to have space between M1 and M2 and M3 and M4.
My layout should be like this
M1 M2 M3 M4
Is this possible in OBIEE ?
Thanks and Regards,
Krishna Prasadkrishna_36 wrote:
Hi,
I have a requirement. I have a cross tab with 4 measures M1, M2, M3, M4. I need to have space between M1 and M2 and M3 and M4.
My layout should be like this
M1 M2 M3 M4
Is this possible in OBIEE ?
Thanks and Regards,
Krishna PrasadIf you want a column padding (i.e., actual blank columns that separate your measures), then create dummy columns between the measures.
1) Click any column and in the fx enter CASE WHEN 1=0 THEN tablename.column_name END
This will create a blank column.
2) Put this in your pivot table, make 3 duplicate layers, and place them in between the 4 measure columns.
In effect, you will have the spaces which you can format to highlight the buffer columns. -
Spacing between columns in SQL*Plus
Is there a way to format a SQL*Plus report so
numeric columns are not preceeded by a space?
I've already have the setting SET COLSEP ''
but that doesn't work on the numeric fields.
I've also tried setting the column format
and converting the numbers to strings. Any
help will be much appreciated!!Numeric values are preceeding with a blank because of the sign (which is not included in the definition number(3,2) = -9.99 to +9.99).
You need to convert to char and trim :
select trim(to_char(mynumber)) mynumber from mytable; -
what is the by default gap between colums in table in oracle
This "gap" is something that the client tool introduces (or fails to introduce) for readability. In SQL*Plus, that is controlled by the COLSEP parameter.
SQL> set colsep ' 'will put three spaces between columns.
SQL> set colsep '|'will put one vertical pipe between columns.
I believe the default in SQL*Plus is generally to use a single space character as the column separator.
Justin -
How to provide space between columns in alv_grid_display?
hi,
gurus,
I want to provide space between columns in alv display how can i achieve that.
ex.
sno name street
thank u ,
shabeer ahmed.Hi..,
There you wl get column seperators with seperate blocks and cells in the grid anyway.
Maintain gap between columns is nothing but grid breaking, its may be possible with oops concept.
Let me know whats your requirement?
Thanks,
Naveen.I -
How to adjust gap between tilelist items?
Hi,
I have a tilelist which uses a custom item renderer component
to render its items. I am seeing a gap between the rows of items
(no gap between columns). I cannot seem to find a property of
tileList which lets you adjust this gap.
Can anyone help?
ThanksEasy tracy. I didnt make as big of a fuss as you are making
comenting about my response. Perhapse you could've used that time
to answer someones question?
Also, the solution I mentioned actually only solved part of
the problem:
By setting the paddingtop and paddingbottom, I can adjust the
gap between the row, but paddingleft and padding right on the
tileList control has no affect on the gap between the columns
(horizontal gap between items)?
Thanks to anyone taking their time to help :) -
SQL Lead & Lag to find gap between dates
i have a table with two columns event_start and event_end :
CREATE TABLE MYBATCHTAB
EVENT_START DATE NOT NULL,
EVENT_END DATE NOT NULL
and my data is :
Insert into MYBATCHTAB
(EVENT_START, EVENT_END)
Values
(TO_DATE('08/12/2013 22:45:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2013 23:55:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into MYBATCHTAB
(EVENT_START, EVENT_END)
Values
(TO_DATE('08/12/2013 15:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2013 17:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into MYBATCHTAB
(EVENT_START, EVENT_END)
Values
(TO_DATE('08/12/2013 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2013 17:30:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into MYBATCHTAB
(EVENT_START, EVENT_END)
Values
(TO_DATE('08/12/2013 20:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2013 22:00:00', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
Event Start
Event End
08/12/2013 15:30:00
08/12/2013 17:00:00
08/12/2013 16:00:00
08/12/2013 17:30:00
08/12/2013 20:00:00'
08/12/2013 22:00:00
08/12/2013 22:45:00
08/12/2013 23:55:00
and i want to find the first whole start - end period in this example start : 15:30 - end 17:30 (merging record 1&2 )
but not the third one for example not 15.30 - 22:00 or not 15.30 23:55 because there are gaps between end dates.
how can i do this using lead&lag ?
I'm not sure if this is the best approachMaybe a baby-step solution
select event_start,event_end
from (select event_start,
case when overlap is not null
then case when lead(overlap,1) over (order by event_start) is not null
then lead(event_end,1) over (order by event_start)
when lag(overlap,1) over (order by event_start) is not null
then null
end
else event_end
end event_end
from (select event_start,event_end,
case when lead(event_start,1) over (order by event_start) <= event_end
or lag(event_end,1) over (order by event_start) >= event_start
then 'overlap'
end overlap
from mybatchtab
where event_end is not null
order by event_start
EVENT_START
EVENT_END
08/12/2013 15:30:00
08/12/2013 17:30:00
08/12/2013 20:00:00
08/12/2013 22:00:00
08/12/2013 22:45:00
08/12/2013 23:55:00
or when there can be more than two consecutive overlaps
select event_start,
event_end
from (select case when lag_overlap is null
then event_start
end event_start,
case when coalesce(lead_overlap,lag_overlap) is null
then event_end
when lag_overlap is null and lead_overlap is not null
then lead(event_end) over (order by event_start)
end event_end
from (select event_start,event_end,
case when event_start < lag(event_end) over (order by event_start)
then 'overlap'
end lag_overlap,
case when event_end > lead(event_start) over (order by event_start)
then 'overlap'
end lead_overlap
from mybatchtab
where lead_overlap is null
or lag_overlap is null
where event_end is not null
and event_end is not null
order by event_start
Regards
Etbin -
IPhone 5 screen has visible gap between vertical pixel columns...
Hi, i might be nitpicking the issue but my new iPhone 5 (White) has a visible gap between each pixel colum (vertical only). Ever since the iPhone 4 came out I was amazed by how "sharp" everything looked and even the smallest text would barely be very crisp and legible. We have two iPhone 5's in the family and the newest one built week 21 of 2013 has this annoying visible vertical gap. It's mostly noticable on solid lighter colors. The older 4 & 5 phones are as crisp as always. I've shown it to several people and they have been able to spot the difference. Has anyone else noticed this? I've checked out a few display models at the Apple Store and half of them seem to be like mine, the other half are not. I'm thinking the ones that are like mine must all be fitted with the same display supplier or there might be a video chip issue of some sort. Any help would be appreciated. Thank you.
No , it's common at least I got this issue. I just replaced my iphone due to power butto failure and now I my replacement unt exactly like what ts stated. When you stare on the screen it's quite hard to notice, it's visible when move your eyes or the phone left right. It's very clear on grey and blue color.
I think it's not screen defective but lower cost LCD vendor , I got this kind of issue on my replacement dell LCD too( Samsung ) then I straight ask for lg screen which is same brand as original and no such problem.
Btw I will still ask for replacement from apple -
Need a Space in Pl/sql Output
Hi ,
Below is my Script for Dropping and Creating the Schema in Oracle 11g Database R1 on Windows 2003 Server R2 SP2
DECLARE
acount NUMBER := 0;
host_name VARCHAR2 (100);
query1 VARCHAR2 (1000)
:= 'CREATE USER &Client_Name PROFILE DEFAULT IDENTIFIED BY &Client_Name DEFAULT TABLESPACE &Client_Name TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK';
query2 VARCHAR2 (1000)
:= 'ALTER USER &Client_Name QUOTA UNLIMITED ON &Client_Name';
BEGIN
SELECT 1
INTO acount
FROM dba_users
WHERE username = '&Client_Name';
SELECT host_name
INTO host_name
FROM v$instance;
IF acount >= 1 THEN
EXECUTE IMMEDIATE 'DROP USER &Client_Name CASCADE';
DBMS_OUTPUT.put_line ('Mentioned Schema_Name is Dropped in '||host_name||' Server');
EXECUTE IMMEDIATE query1;
EXECUTE IMMEDIATE query2;
DBMS_OUTPUT.put_line ('New Schema is Created in '||host_name||' Server');
END IF;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
SELECT host_name INTO host_name FROM v$instance;
EXECUTE IMMEDIATE query1;
EXECUTE IMMEDIATE query2;
DBMS_OUTPUT.put_line ('New Schema is Created in '||HOST_NAME||' Server');
END;
Output is
Mentioned Schema_Name is Dropped in DEV11GAS Server
New Schema is Created in DEV11GAS Server
But i need the Output Like below
Mentioned Schema_Name is Dropped in DEV11GAS Server
New Schema is Created in DEV11GAS Server
Just Need a Space/gap between the two line..... Please Advice
Thanks
ShanYour post is a bit misleading. You have not posted your SERVEROUTPUT commands.
See the below examples.
SQL> show serverout
serveroutput OFF
SQL> SET SERVEROUTPUT ON
SQL> begin
2 dbms_output.put_line('Hello');
3 dbms_output.new_line;
4 dbms_output.put_line('World');
5 end;
6 /
Hello
World
PL/SQL procedure successfully completed.
SQL> SET SERVEROUTPUT ON FORMAT WRAPPED
SQL> begin
2 dbms_output.put_line('Hello');
3 dbms_output.new_line;
4 dbms_output.put_line('World');
5 end;
6 /
Hello
World
PL/SQL procedure successfully completed.
SQL>the new_line procedure is not working because of your SQL *PLUS settings. -
Valid Time Support - filling in gaps between non-contiguous records
Is there an easy (or recommended) way to fill in gaps in records stored in a table with Valid Time Support?
Here's my scenario. Suppose there are two "valid time" records for Adams in the table, one that's valid from 1/1/2000 to 1/1/2001 and the other that is valid from 1/1/2002 to 1/1/2003. In other words, there's a one year gap between the two records. The user wants to make a single edit to Adams that covers a broader period of time, e.g. 1/1/1999 to 1/1/2005, which should include the gap between these two records (and the gaps before the first record, from 1/1999 to 1/2000, and the gap after the last record, from 1/2003 to 1/2005).
What's the best way to do this?
I've tried setting the session time using DBMS_WM.SetValidTime() from 1/1/1999 to 1/1/2005, and then updating the database. But the update only changes the updated column (e.g. salary) without altering the VM_VALID timestamps.
Initial values:
NAME SALARY WM_VALID
Adams 30000 (1/1/2000 12:00:00.000000 AM -04:00, 1/1/2001 12:00:00.000000 AM -04:00)
Adams 31000 (1/1/2002 12:00:00.000000 AM -04:00, 1/1/2003 12:00:00.000000 AM -04:00)
==========
DBMS_WM.SetValidTime(TO_DATE('01-01-1999', 'MM-DD-YYYY'), TO_DATE('01-01-2005', 'MM-DD-YYYY'));
UPDATE tester_timevalues SET salary = 45000 WHERE name = 'Adams';
==========
Updated values:
Adams 45000 (1/1/2000 12:00:00.000000 AM -04:00, 1/1/2001 12:00:00.000000 AM -04:00)
Adams 45000 (1/1/2002 12:00:00.000000 AM -04:00, 1/1/2003 12:00:00.000000 AM -04:00)
I know this is "works as designed". But is there a relatively painless way to fill in the gaps in the records?Thanks, Ben. I will give that approach a try.
BTW, I have an even better example where detecting and filling "gaps" in the effective dated periods is necessary.
Suppose I have a link table (GroupMembership) with foreign key links to an Employee and a Group table. Say that there's currently a record in the GroupMembership table indicating that Bob was a member of the Steering Committee group from 1/2002 to 1/2004. The information now needs to be amended to indicate that Bob was really a member from 1/2000 to 1/2006. Even if the GroupMembership table has a column that allows us to UPDATE it, the UPDATE will only affect the 2002 to 2004 range, even though we've called SetValidTime() for the range of 2000 to 2006.
We'll have to cook up some SQL to handle this case. But this seems like a case where Oracle's Valid Time Support could make this make this type of scenario easier to handle.
As it works now, Valid Time Support will indicate that there is a record for the requested time period (2000 to 2006), but doesn't indicate that the record's valid time period is different than the requested time period (at least not without some additional work on the developer's part).
Just a thought... -
Hi all,
I have displayed a table in smartform. now i need to have a gap between each of the table row..
So how to display a blank line between each of the table row?
Regards,
ShanthiHi,
May be this will help you.
1. Create one extra coloumn in the internal table.But don't populate any values in that column.
2. For each column you will fill o/p options with line type right. for this column fill with line type LINE2 in output options.
LINE1 is common which generally you are using.
3. create that that Line type LINE2 with table lenght and single column.
4. don't put this extra coumn in header of the table.
let me know if any issues.
reward points if helpful
Thanks,
suma -
Where do I look at UTLTZUV2.SQL output?
Dear gurus,
I'm in the process of applying Security Patch 16: 6637237(CPUJAN2008) on my Windows 32bit envs. In this process, I need to check the existing TSTZ data using this oracle provided script. I ran it and didn't see the result. Here in the info I got:
SQL> SET ECHO ON
SQL> @c:\C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utltzuv2.sql
SP2-0310: unable to open file "c:\C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utltzuv2.sql"
SQL> @c:\C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utltzuv2.sql
SP2-0310: unable to open file "c:\C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utltzuv2.sql"
SQL> @c:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utltzuv2.sql
SQL> Rem
SQL> Rem $Header: utltzuv2.sql 21-dec-2006.02:22:10 huagli Exp $
SQL> Rem
SQL> Rem utltzuv2.sql
SQL> Rem
SQL> Rem Copyright (c) 2003, 2006, Oracle. All rights reserved.
SQL> Rem
SQL> Rem NAME
SQL> Rem utltzuv2.sql - time zone file upgrade to a new version script
SQL> Rem
SQL> Rem DESCRIPTION
SQL> Rem The contents of the files timezone.dat and timezlrg.dat
SQL> Rem are usually updated to a new version to reflect the transition rule
SQL> Rem changes for some time zone region names. The transition rule
SQL> Rem changes of some time zones might affect the column data of
SQL> Rem TIMESTAMP WITH TIME ZONE data type. For example, if users
SQL> Rem enter TIMESTAMP '2003-02-17 09:00:00 America/Sao_Paulo',
SQL> Rem we convert the data to UTC based on the transition rules in the
SQL> Rem time zone file and store them on the disk. So '2003-02-17 11:00:00'
SQL> Rem along with the time zone id for 'America/Sao_Paulo' is stored
SQL> Rem because the offset for this particular time is '-02:00' . Now the
SQL> Rem transition rules are modified and the offset for this particular
SQL> Rem time is changed to '-03:00'. when users retrieve the data,
SQL> Rem they will get '2003-02-17 08:00:00 America/Sao_Paulo'. There is
SQL> Rem one hour difference compared to the original value.
SQL> Rem
SQL> Rem Refer to $ORACLE_HOME/oracore/zoneinfo/readme.txt for detailed
SQL> Rem information about time zone file updates.
SQL> Rem
SQL> Rem This script should be run before you update your database's
SQL> Rem time zone file to the latest version. This is a pre-update script.
SQL> Rem
SQL> Rem This script first determines the time zone version currently in use
SQL> Rem before the upgrade. It then queries an external table to get all the
SQL> Rem affected timezone regions between the current version (version before
SQL> Rem the update) and the latest one. This external table points to the file
SQL> Rem timezdif.csv, which contains all the affected time zone names in each
SQL> Rem version. Please make sure that you have the latest version of the
SQL> Rem timezdif.csv (the one corresponding to the latest timezone data file),
SQL> Rem before you run the script.
SQL> Rem
SQL> Rem Then, this script scans the database to find out all columns
SQL> Rem of TIMESTAMP WITH TIME ZONE data type. If the column is
SQL> Rem in the regular table, the script also finds out how many
SQL> Rem rows might be affected by checking whether the column data
SQL> Rem contain the values for the affected time zone names.
SQL> Rem If the column is in the nested table's storage table, we
SQL> Rem don't scan the data to find out how many rows are affected but
SQL> Rem we still report the table and column info.
SQL> Rem
SQL> Rem The result is stored in the table sys.sys_tzuv2_temptab.
SQL> Rem Before running the script, make sure the table name doesn't
SQL> Rem conflict with any existing table object. It it does,
SQL> Rem change the table name sys.sys_tzuv2_temptab to some other name
SQL> Rem in the script. You can query the table to view the result:
SQL> Rem select * from sys.sys_tzuv2_temptab;
SQL> Rem
SQL> Rem If your database has column data that will be affected by the
SQL> Rem time zone file update, dump the data before you upgrade to the
SQL> Rem new version. After the upgrade, you need update the data
SQL> Rem to make sure the data is stored based on the new rules.
SQL> Rem
SQL> Rem For example, user scott has a table tztab:
SQL> Rem create table tztab(x number primary key, y timestamp with time zone);
SQL> Rem insert into tztab values(1, timestamp '');
SQL> Rem
SQL> Rem Before upgrade, you can create a table tztab_back, note
SQL> Rem column y here is defined as VARCHAR2 to preserve the original
SQL> Rem value.
SQL> Rem create table tztab_back(x number primary key, y varchar2(256));
SQL> Rem insert into tztab_back select x,
SQL> Rem to_char(y, 'YYYY-MM-DD HH24.MI.SSXFF TZR') from tztab;
SQL> Rem
SQL> Rem After upgrade, you need update the data in the table tztab using
SQL> Rem the value in tztab_back.
SQL> Rem update tztab t set t.y = (select to_timestamp_tz(t1.y,
SQL> Rem 'YYYY-MM-DD HH24.MI.SSXFF TZR') from tztab_back t1 where t.x=t1.x);
SQL> Rem
SQL> Rem Or you can use export utility to export your data before the upgrade
SQL> Rem and them import your data again after the upgrade.
SQL> Rem
SQL> Rem drop table sys.sys_tzuv2_temptab;
SQL> Rem once you are done with the time zone file upgrade.
SQL> Rem
SQL> Rem NOTES
SQL> Rem * This script needs to be run before upgrading to a new version time
SQL> Rem zone file. Also, before running this script, please make sure that
SQL> Rem you get the latest version of timezdif.csv file.
SQL> Rem * This script must be run using SQL*PLUS.
SQL> Rem * You must be connected AS SYSDBA to run this script.
SQL> Rem * This script is created only for Oracle 10.1 or higer. A separate
SQL> Rem script is provided for Oracle 9i.
SQL> Rem * Two files, tzuv2ext_*.log and tzuv2ext_*.bad will be created in
SQL> Rem the directory of $ORACLE_HOME/oracore/zoneinfo when using the
SQL> Rem external table for timezdif.csv file to get the affected time zones.
SQL> Rem After running the script, please refer to these two files to see if
SQL> Rem there are any rows in timezdif.csv, which are not loaded. If so,
SQL> Rem it might affect the correct selection of affected tables in the database.
SQL> Rem You can always delete tzuv2ext_*.log and tzuv2ext_*.bad.
SQL> Rem * A Java stored procedure is created to get the system file separator,
SQL> Rem e.g., Windows uses '\' and Unix uses '/'. Before you run this script,
SQL> Rem make sure that the Java source/class object does not conflict with
SQL> Rem any existing Java source/class object in the database. If it does, please
SQL> Rem change the Java source/class object name GetFileSeparator to some other
SQL> Rem name in the script. Also make sure that the Java stored procedure does not
SQL> Rem conflict with any existing function in the database. If it does, please
SQL> Rem change the function name GET_FILE_SEPARATOR to some other name in the script.
SQL> Rem If renaming is needed, please make sure that you change all the occurences
SQL> Rem to make them consistent.
SQL> Rem
SQL> Rem
SQL> Rem MODIFIED (MM/DD/YY)
SQL> Rem huagli 12/21/06 - Backport huagli_bug-5126270 from main
SQL> Rem time zone update
SQL> Rem srsubram 05/12/05 - 4331865:Modify script to work with prior
SQL> Rem releases
SQL> Rem lkumar 05/11/04 - Fix lrg 1691434.
SQL> Rem rchennoj 12/02/03 - Fix query
SQL> Rem qyu 11/22/03 - qyu_bug-3236585
SQL> Rem qyu 11/17/03 - Created
SQL> Rem
SQL>
SQL> SET SERVEROUTPUT ON
SQL>
SQL> Rem=========================================================================
SQL> Rem Check any existing table with this name sys.sys_tzuv2_temptab
SQL> Rem=========================================================================
SQL> DROP TABLE sys.sys_tzuv2_temptab
2 /
DROP TABLE sys.sys_tzuv2_temptab
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> CREATE TABLE sys.sys_tzuv2_temptab
2 (
3 table_owner VARCHAR2(30),
4 table_name VARCHAR2(30),
5 column_name VARCHAR2(30),
6 rowcount NUMBER,
7 nested_tab VARCHAR2(3)
8 )
9 /
Table created.
SQL>
SQL> Rem========================================================================
SQL> Rem Check any existing table with this name sys.sys_tzuv2_temptab1
SQL> Rem========================================================================
SQL> DROP TABLE sys.sys_tzuv2_temptab1
2 /
DROP TABLE sys.sys_tzuv2_temptab1
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> CREATE TABLE sys.sys_tzuv2_temptab1
2 (
3 time_zone_name VARCHAR2(60)
4 )
5 /
Table created.
SQL>
SQL> DECLARE
2
3 dbv VARCHAR2(10);
4 dbtzv VARCHAR2(5);
5 numrows NUMBER;
6 TYPE cursor_t IS REF CURSOR;
7 cursor_tstz cursor_t;
8 tstz_owner VARCHAR2(30);
9 tstz_tname VARCHAR2(30);
10 tstz_qcname VARCHAR2(4000);
11 tz_version NUMBER;
12 oracle_home VARCHAR(4000);
13 tz_count INTEGER;
14 plsql_block VARCHAR2(200);
15 file_separator VARCHAR2(3);
16
17 BEGIN
18
19 --========================================================================
20 -- Make sure that only version 10 or higher uses this script
21 --========================================================================
22
23 SELECT substr(version,1,6) INTO dbv FROM v$instance;
24
25 IF dbv = '8.1.7.'
26 THEN
27 DBMS_OUTPUT.PUT_LINE('TIMEZONE data type was not supported in ' ||
28 'Release 8.1.7.');
29 DBMS_OUTPUT.PUT_LINE('No need to validate TIMEZONE data.');
30 RETURN;
31 END IF;
32
33 IF dbv in ('9.0.1.','9.2.0.')
34 THEN
35 DBMS_OUTPUT.PUT_LINE('Please contact Oracle support to get the script ' ||
36 'for Release 9.0.1 or 9.2.0.');
37 RETURN;
38 END IF;
39
40 --========================================================================
41 -- Get $ORACLE_HOME
42 --========================================================================
43
44 plsql_block := 'BEGIN SYS.DBMS_SYSTEM.GET_ENV(:1, :2); END;';
45 EXECUTE IMMEDIATE plsql_block USING 'ORACLE_HOME', OUT oracle_home;
46
47 --========================================================================
48 -- Use an external table created on timezdif.csv file to get the
49 -- affected time zones. In this way, every time when time zone information
50 -- changes, we only need to provide user with the updated timezdif.csv file
51 -- without changing utltzuv2.sql.
52 --
53 -- 1. Setup the directory for timezdif.csv and log files(log, bad log)
54 -- 2. Check any existing external table with this name
55 -- sys.sys_tzuv2_affected_regions
56 -- 3. Setup the parameters of the external table
57 --========================================================================
58
59 --========================================================================
60 -- Create a Java stored procedure to get the file separator
61 --========================================================================
62
63 EXECUTE IMMEDIATE 'CREATE OR REPLACE AND COMPILE JAVA SOURCE
64 NAMED "GetFileSeparator" AS
65 public class GetFileSeparator {
66 public static String get() {
67 return System.getProperty("file.separator");
68 }
69 }';
70
71 EXECUTE IMMEDIATE 'CREATE OR REPLACE FUNCTION GET_FILE_SEPARATOR
72 RETURN VARCHAR2
73 AS LANGUAGE JAVA
74 NAME ''GetFileSeparator.get() return java.lang.String'';';
75
76
77 plsql_block := 'BEGIN :1 := GET_FILE_SEPARATOR(); END;';
78 EXECUTE IMMEDIATE plsql_block USING OUT file_separator;
79
80 EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY timezdif_dir AS ''' ||
81 oracle_home || file_separator || 'oracore' ||
82 file_separator || 'zoneinfo''';
83
84
85 EXECUTE IMMEDIATE
86 'SELECT count(*)
87 FROM all_tables
88 WHERE owner = ''SYS'' and table_name = ''SYS_TZUV2_AFFECTED_REGIONS'''
89 INTO tz_count;
90
91 IF tz_count <> 0
92 THEN
93 EXECUTE IMMEDIATE 'DROP TABLE sys.sys_tzuv2_affected_regions';
94 END IF;
95
96
97 EXECUTE IMMEDIATE 'CREATE TABLE sys.sys_tzuv2_affected_regions
98 (
99 version NUMBER,
100 time_zone_name VARCHAR2(40),
101 from_year NUMBER,
102 to_year NUMBER
103 )
104 ORGANIZATION EXTERNAL
105 (
106 TYPE ORACLE_LOADER
107 DEFAULT DIRECTORY timezdif_dir
108 ACCESS PARAMETERS
109 (
110 records delimited by newline
111 badfile timezdif_dir:''tzuvext%a_%p.bad''
112 logfile timezdif_dir:''tzuvext%a_%p.log''
113 fields terminated by '',''
114 lrtrim
115 missing field values are null
116 (
117 version, time_zone_name, from_year, to_year
118 )
119 )
120 LOCATION (''timezdif.csv'')
121 )
122 REJECT LIMIT UNLIMITED';
123
124 --======================================================================
125 -- Check if the TIMEZONE data is consistent with the latest version.
126 --======================================================================
127
128 EXECUTE IMMEDIATE 'SELECT version FROM v$timezone_file' INTO tz_version;
129 EXECUTE IMMEDIATE 'SELECT MAX(version) FROM sys_tzuv2_affected_regions' INTO dbtzv;
130
131 IF tz_version = dbtzv
132 THEN
133 DBMS_OUTPUT.PUT_LINE('TIMEZONE data is consistent with the latest version ' ||
134 dbtzv || ' transition rules');
135 DBMS_OUTPUT.PUT_LINE('No need to validate TIMEZONE data');
136 RETURN;
137 END IF;
138
139 --======================================================================
140 -- Get tables with columns defined as type TIMESTAMP WITH TIME ZONE.
141 --======================================================================
142
143 OPEN cursor_tstz FOR
144 'SELECT atc.owner, atc.table_name, atc.qualified_col_name ' ||
145 'FROM "ALL_TAB_COLS" atc, "ALL_TABLES" at ' ||
146 'WHERE data_type LIKE ''TIMESTAMP%WITH TIME ZONE''' ||
147 ' AND atc.owner = at.owner AND atc.table_name = at.table_name ' ||
148 'ORDER BY atc.owner, atc.table_name, atc.column_name';
149
150 --======================================================================
151 -- Query the external table to get all the affected time zones based
152 -- on the current database time zone version, and then put them into
153 -- a temporary table, sys_tzuv2_temptab1.
154 --======================================================================
155
156 EXECUTE IMMEDIATE
157 'INSERT INTO sys.sys_tzuv2_temptab1
158 SELECT DISTINCT time_zone_name
159 FROM sys.sys_tzuv2_affected_regions t
160 WHERE t.version > ' || tz_version;
161
162 EXECUTE IMMEDIATE 'ANALYZE TABLE sys.sys_tzuv2_temptab1 ' ||
163 'COMPUTE STATISTICS';
164
165 --======================================================================
166 -- Check regular table columns.
167 --======================================================================
168 LOOP
169 BEGIN
170 FETCH cursor_tstz INTO tstz_owner, tstz_tname, tstz_qcname;
171 EXIT WHEN cursor_tstz%NOTFOUND;
172
173 EXECUTE IMMEDIATE
174 'SELECT COUNT(1) FROM ' ||
175 tstz_owner || '."' || tstz_tname || '" t_alias, ' ||
176 ' sys.sys_tzuv2_temptab1 r ' ||
177 ' WHERE UPPER(r.time_zone_name) = ' ||
178 ' UPPER(TO_CHAR(t_alias.' || tstz_qcname || ', ''TZR'')) ' INTO numrows;
179
180 IF numrows > 0 THEN
181 EXECUTE IMMEDIATE ' INSERT INTO sys.sys_tzuv2_temptab VALUES (''' ||
182 tstz_owner || ''',''' || tstz_tname || ''',''' ||
183 tstz_qcname || ''',' || numrows || ', ''NO'')';
184 END IF;
185
186 EXCEPTION
187 WHEN OTHERS THEN
188 DBMS_OUTPUT.PUT_LINE('OWNER : ' || tstz_owner);
189 DBMS_OUTPUT.PUT_LINE('TABLE : ' || tstz_tname);
190 DBMS_OUTPUT.PUT_LINE('COLUMN : ' || tstz_qcname);
191 DBMS_OUTPUT.PUT_LINE(SQLERRM);
192 END;
193 END LOOP;
194
195 --======================================================================
196 -- Check nested table columns.
197 --======================================================================
198
199 EXECUTE IMMEDIATE
200 'INSERT INTO sys.sys_tzuv2_temptab
201 SELECT owner, table_name, qualified_col_name, NULL, ''YES''
202 FROM ALL_NESTED_TABLE_COLS
203 WHERE data_type like ''TIMESTAMP%WITH TIME ZONE''';
204
205
206 DBMS_OUTPUT.PUT_LINE('Query sys.sys_tzuv2_temptab table to see ' ||
207 'if any TIMEZONE data is affected by version ' || dbtzv ||
208 ' transition rules');
209
210 EXCEPTION
211 WHEN OTHERS THEN
212 IF INSTR(SQLERRM, 'KUP-04063') != 0
213 THEN
214 DBMS_OUTPUT.PUT_LINE('Directory for file timezdif.csv is not correctly specified!');
215 DBMS_OUTPUT.PUT_LINE(sqlerrm);
216 ELSIF INSTR(SQLERRM, 'KUP-04040') != 0
217 THEN
218 DBMS_OUTPUT.PUT_LINE('File timezdif.csv in TIMEZDIF_DIR not found!');
219 ELSE
220 DBMS_OUTPUT.PUT_LINE(SQLERRM);
221 END IF;
222
223 END;
224 /
ORA-25153: Temporary Tablespace is Empty
PL/SQL procedure successfully completed.
SQL>
SQL> COMMIT
2 /
Commit complete.
SQL>
SQL> DECLARE
2 tz_count NUMBER;
3
4 BEGIN
5
6 --========================================================================
7 -- After obtaining the file separator, drop the Java stored procedure
8 --========================================================================
9
10 EXECUTE IMMEDIATE
11 'SELECT count(*)
12 FROM user_objects
13 WHERE object_name = ''GetFileSeparator'' and UPPER(object_type) like ''JAVA%'''
14 INTO tz_count;
15
16 IF tz_count > 0
17 THEN
18 EXECUTE IMMEDIATE 'DROP JAVA SOURCE "GetFileSeparator"';
19 END IF;
20
21 EXECUTE IMMEDIATE
22 'SELECT count(*)
23 FROM user_objects
24 WHERE object_name = ''GET_FILE_SEPARATOR'' and UPPER(object_type) = ''FUNCTION'''
25 INTO tz_count;
26
27 IF tz_count > 0
28 THEN
29 EXECUTE IMMEDIATE 'DROP FUNCTION GET_FILE_SEPARATOR';
30 END IF;
31
32 END;
33 /
PL/SQL procedure successfully completed.
SQL>
SQL> COMMIT
2 /
Commit complete.
SQL>
SQL> Rem=========================================================================
SQL> SET SERVEROUTPUT OFF
SQL> Rem=========================================================================
SQL> spool off
Could you help me find the TSTZ data if there are any? Thank you in advance.Ok, I found out that I need to apply the patch 5746875 to have that. But there only instruction to apply this patch on unix env. I need on Windows. Can any body help me?
-
Gap between two characters in SAP Script Address EndAddress.
Hi Abapers,
I have one query regarding Address - EndAddress in SAPScript.
I am putting the code :
/: ADDRESS TYPE '1' PARAGRAPH ZI PRIORITY 'APL43' LINES 6
/:ADDRESSNUMBER &ZPOLGORT-ADRNR&
/:ENDADDRESS
and I am getting the output in this form
<b><i>ABC Soft c/o JSI Hong Kon g
c/o RS Logistics (Shenzhen) Limited
6/F., DZ Zhong Tian Yuan Logistics Ctr.
126/Xia Road, Futian Free Zone,
Shenzhen
China</i></b>
But the problem is there is a gap between character "n" and 'g" in first line in word Kong.
Can anybody suggest me how to solve this issue. Or is there any other issues to sort it out this problem.Hi,
Its not the problem with Address / End Address.
It could be probably maintained that way.
Please check the entry in the table where it is maintained.
reagrds, -
How do I remove a gap between table rows in InDesign?
I need help in figuring out how to remove gaps between table rows. I have tried Table Spacing under Table Set-up, but it doesn't work.
Here's what I'm working on:
As you can see there are gaps above the first row and below last row under the header Business Management Technology. I cannot select that gap. How do I remove it, so that the first class, 31058, is flush with the black header? (and the last class, 32675, is flush with the Chemistry header?)
Any advice would be greatly appreciated.
Thanks,
SarahSRiegel wrote:
...it may be that the black bar is created with a paragraph rule instead of cell color.
I hadn't considered that, and your example is proof-of-concept. However, now that you made me look closer, I still don't think that's the OP's case, seeing as the text in the OP's header rows appears to span more than one column, belying what I suppose must be merged cells.* The column strokes in the "gap" appear to disqualify it (the gap) as part of a row with merged cells.
*There is still another possibility that someone "made pictures" of tables with merged cells by overlaying text frames to make the header rows. I've run across all kinds of such "carpentry;" especially when the file may have originated at the desk of someone who avoids or resists use of tables. They find ways to fake them and/or their features.
[still looking] -
Line gap between record to record using FCC
Hi Experts,
i am working on xml to fcc scenario.In target text file i want line gap between each record.
eg:
1001,ABCD,23
1002,CDF,45
1003,FSF,34
what are the parameters do i need to provide in reciever fcc adapter?
please help me in this issue.
Regards,
Radhika.Hi Radhika,
I guess you can achieve this with "NameA.absoluteRowWidth=<noOfColumns>" along with "xml.endSeparator".
If the separators do not contain any line breaks, the text document is generated as a single line of text. To restrict the width of the text, use this parameter. <noOfColumns> represents the maximum number of columns in this case. This parameter also functions together with the specification of a line break for xml.endSeparator.
This value requires NameA.addHeaderLine=0 to be specified.
Give a try..
Regards,
Maybe you are looking for
-
Can I or Will I be able to Create a Schedule??
Hello all! I have finally finally "migrate" to Mail!! (from Entourage 2004) In Mail, I've created a new Mailbox "Forums" to store all my incoming notices of my posts/subscriptions etc of this Discussion, but I don't want to store them forever. In Ent
-
Javascript Code to List all Signature Fields in a PDF Document
Hi everybody, I am doing a VB.NET application that apply a digital signature in a PDF document. My VB.NET application invoke a javascript file that signs de document. It's working very well, but I need to pass the field name to place the signature, a
-
The text/email/alerts sound volume has gone right down on my iPhone 4
The text/email/alerts sound volume has gone right down on my iPhone 4, but the ringtone volume is still loud! Adjusting the volume in "Settings" only changes the ringer volume, I just can't find a way to increase the alerts volume! Help please!!!
-
Open, Open Containing Folder in Windows Explorer Using java
How to open a file using the default application using java code? Ex: - Open a JPG file using its default image viewer (Ex: Piscasa 3)..... (Not Inside the Java Application) Then how to open a file containing folder with that file selected? Couldn't
-
Cannot Save files to original file names to my computer?
I am getting errors when I try to save a file to my hard drive. The program is either denying access to save or saves to the hard drive under a different name. I have hundreds of files related to clients. I do not want re-name all my established file