Formating SQL Plus

Hello,
How do I remove # from my report ?
TABLESPACE USED (MB) FREE (MB) TOTAL (MB) PER_FREE
DLY_DATA 132,320 4,175 136,495 3 %
CONFIG 7,621 749 8,370 9 %
FDATA 210,299 4,234 214,533 2 %
CONFIG_DATA 12,324 468 12,792 4 %
CONFIG_IDX 3,793 303 4,096 7 %
WEI_DATA ######## 26,995 ######## 2 %
WEI_IDX 245,450 5,118 250,568 2 %
MAN 172 8 180 4 %
TRON_INDX 1,474 24 1,498 2 %
DBDAT 4,511 117 4,628 3 %
TS_DATA 149,442 6,704 156,146 4 %
TS_INDEX 105,434 2,610 108,044 2 %
#!/bin/sh
sqlplus -s ${USER} << HIC
set feed off
set linesize 100
set pagesize 200
#spool tablespace.alert
column "TABLESPACE" format a20
column "USED (MB)" format a10
column "FREE (MB)" format a10
column "TOTAL (MB)" format a10
column "PER_FREE" format a10
SELECT F.TABLESPACE_NAME TABLESPACE,
TO_CHAR ((T.TOTAL_SPACE - F.FREE_SPACE),'999,999') "USED (MB)",
TO_CHAR (F.FREE_SPACE, '999,999') "FREE (MB)",
TO_CHAR (T.TOTAL_SPACE, '999,999') "TOTAL (MB)",
TO_CHAR ((ROUND ((F.FREE_SPACE/T.TOTAL_SPACE)*100)),'999')||' %' PER_FREE
FROM (
SELECT TABLESPACE_NAME,
ROUND (SUM (BLOCKS*(SELECT VALUE/1024
FROM V\$PARAMETER
WHERE NAME = 'db_block_size')/1024)
) FREE_SPACE
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME
) F,
SELECT TABLESPACE_NAME,
ROUND (SUM (BYTES/1048576)) TOTAL_SPACE
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME
) T
WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME
AND (ROUND ((F.FREE_SPACE/T.TOTAL_SPACE)*100)) < 10;
spool off
exit
HIC
Edited by: drbiloukos on 2 Μαρ 2011 11:22 πμ

Use a larger numwidth or format your column explicitly.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#i2699209
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12013.htm#SQPUG034

Similar Messages

  • SQL Plus command to print a report in Landscape format

    Hi,
    what is the SQL Plus command to print a report in Landscape format?

    841731 wrote:
    Hi,
    what is the SQL Plus command to print a report in Landscape format?SQLPlus doesn't print, and it doesn't know about 'landscape' vs. 'portrait' any more than it knows about fonts. the only 'formatting' it knows is line size, page size. And all it does with line size is know where to insert a CR/LF pair (windows) or a CR (*nix). The only thing it knows to do with page size is repeat column headers.
    The rest is up to whatever application you use to open the pure asciii text spool file.

  • Seek help to format spool file from SQL*PLUS

    I am running a Unix shell script to call a Oracle 11g SQL script from a Oracle database. In this SQL script, I need to connect to many different remote databases to select data, then sool these records as one big text file to a directory. Then email the file to related Group users. In the spool file, there is a line on the top of each page like this:
    DUMMY
    DB_NAME
    I know this is caused by connect to remote database in SQL*PLUS. My connection string is like this:
    Conn system/password@Oracle_SID
    How can I remove these lines or how to skip these lines into spool file? Please advise. Thanks in advnce. Wish all of you Happy New Year!!!

    Hi,
    It sounds like you have some kind of formatting (such as SQL*Plus TTITLE) producing the output you don't want. If that's the case, temporarily stopping the spooling might not help you. Find out what is causing the output that you don't want. You say that you know it is caused by the CONNECT statements, but it must be more than that. I've written scripts with CONNECT statements that don't have anything like what you reported at the top of each page; in fact, they don't even have pages: the output is one continuous stream. Find out what's putting the unwanted output there, and that will be a big clue as to how you can stop it.
    You say that you know the unwanted titles are there because of the CONNECT statements. If so, use database links instead of CONNECT. You don't have to use dbms_scheduler or utl_file; just eliminate the CONNECT statements. (I'm not saying that there's anything wrong with dbms_scheduler or utl_file; you should definitely investigate those tools. I'm just saying that using database links is independent of them.)
    What would happen if you did all your connecting to different databases at the OS level? Can you write a shell script that connects to each database in turn, and runs a SQL*Plus script in each one. Each SQL*Plus script would have a SPOOL or SPOOL ... APPEND command, or maybe you could build the SPOOL into a LOGIN.SQL script.

  • Oracle SQL Developer 3.2, SQL*Plus COLUMN FORMAT bug

    SQL*Plus command COLUMN truncates output result in SQL Developer.
    Script in Worksheet:
    column nn format 999
    select level nn from dual connect by level<=10;The Run Script (F5) result contains only 8 lines in Script Output window:
    NN
    1
    2
    3
    4
    5
    6
    7
    8
    Changing column alias:
    select level nn2 from dual connect by level<=10NN2
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected
    The output can contain no data for more formatted columns.
    ===============================================================
    About
    Oracle SQL Developer 3.2.09
    Version 3.2.09
    Build MAIN-09.30
    Copyright © 2005, 2012 Oracle. All Rights Reserved.
    IDE Version: 11.1.1.4.37.59.48
    Product ID: oracle.sqldeveloper
    Product Version: 11.2.0.09.30
    Version
    Component     Version
    =========     =======
    Java(TM) Platform     1.7.0_02
    Oracle IDE     3.2.09.30
    Versioning Support     3.2.09.30

    sqldeveloper64-3.2.09.30-no-jre.zip.
    My jdk now is 1.7.07 x64, Windows 7 x64.
    C:\Java\jdk17\bin>java -version
    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
    Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
    Gary Graham wrote:Also, I don't understand what you mean by
    The output can contain no data for more formatted columns.
    Sript:
    col owner format a10
    col table_name format a20
    col column_name format a20
    col comments format a50
    select
       row_number() over(order by column_name) r11,   
       count(*) over() c11,
       owner ow,
       table_name tn,
       column_name cn,
       comments co
    from all_col_comments t
    where owner='SYS' and table_name='INDEX_STATS';
    select
       row_number() over(order by column_name) r,   
       count(*) over() c,
       owner,
       table_name,
       column_name,
       comments
    from all_col_comments t
    where owner='SYS' and table_name='INDEX_STATS';
    select 1 from dual;
    prompt abcThe output truncated after headers of second queryR11 C11 OW                             TN                             CN                             CO                                                                                                                                                        
      1  25 SYS                            INDEX_STATS                    BLKS_GETS_PER_ACCESS           Expected number of consistent mode block gets per row. This assumes that a row chosen at random from the table is being searched for using the index
      2  25 SYS                            INDEX_STATS                    BLOCKS                         blocks allocated to the segment                                                                                                                    
      3  25 SYS                            INDEX_STATS                    BR_BLKS                        number of branch blocks in the b-tree                                                     
      4  25 SYS                            INDEX_STATS                    BR_BLK_LEN                     useable space in a branch block                                                           
      5  25 SYS                            INDEX_STATS                    BR_ROWS                        number of branch rows                                                                     
      6  25 SYS                            INDEX_STATS                    BR_ROWS_LEN                    sum of the lengths of all the branch blocks in the b-tree                                 
      7  25 SYS                            INDEX_STATS                    BTREE_SPACE                    total space currently allocated in the b-tree                                             
      8  25 SYS                            INDEX_STATS                    DEL_LF_ROWS                    number of deleted leaf rows in the index                                                  
      9  25 SYS                            INDEX_STATS                    DEL_LF_ROWS_LEN                total length of all deleted rows in the index                                             
    10  25 SYS                            INDEX_STATS                    DISTINCT_KEYS                  number of distinct keys in the index                                                      
    11  25 SYS                            INDEX_STATS                    HEIGHT                         height of the b-tree                                                                      
    12  25 SYS                            INDEX_STATS                    LF_BLKS                        number of leaf blocks in the b-tree                                                       
    13  25 SYS                            INDEX_STATS                    LF_BLK_LEN                     useable space in a leaf block                                                             
    14  25 SYS                            INDEX_STATS                    LF_ROWS                        number of leaf rows (values in the index)                                                 
    15  25 SYS                            INDEX_STATS                    LF_ROWS_LEN                    sum of the lengths of all the leaf rows                                                   
    16  25 SYS                            INDEX_STATS                    MOST_REPEATED_KEY              how many times the most repeated key is repeated                                          
    17  25 SYS                            INDEX_STATS                    NAME                           name of the index                                                                         
    18  25 SYS                            INDEX_STATS                    OPT_CMPR_COUNT                 optimal prefix compression count for the index                                            
    19  25 SYS                            INDEX_STATS                    OPT_CMPR_PCTSAVE               percentage storage saving expected from optimal prefix compression                        
    20  25 SYS                            INDEX_STATS                    PARTITION_NAME                 name of the index partition, if partitioned                                               
    21  25 SYS                            INDEX_STATS                    PCT_USED                       percent of space allocated in the b-tree that is being used                               
    22  25 SYS                            INDEX_STATS                    PRE_ROWS                       number of prefix rows (values in the index)                                               
    23  25 SYS                            INDEX_STATS                    PRE_ROWS_LEN                   sum of lengths of all prefix rows                                                         
    24  25 SYS                            INDEX_STATS                    ROWS_PER_KEY                   average number of rows per distinct key                                                   
    25  25 SYS                            INDEX_STATS                    USED_SPACE                     total space that is currently being used in the b-tree                                    
    25 rows selected
    R C OWNER      TABLE_NAME           COLUMN_NAME          COMMENTS                                        
    - - ---------- -------------------- -------------------- --------------------------------------------------

  • SQL*Plus Worksheet formating

    I have Oracle Client 8.1.7 installed in my computer, and I can't
    seem to have the desired output format with the SQL*Plus
    worksheet.
    I have a database where the tables have several column, and most
    of these columns are text with 1024 characters length. I set the
    linesize to a huge number (say 3000), the trim and trimspool on,
    and I get the results ok.
    But, when I want to do a select from a table which is much
    smaller, the worksheet is always writing the complete linesize...
    Is there a way to display the columns according to the size they
    actually have (e.g. defined by the longest element) that is
    always valid. I mean without having to set column options for
    each table.
    Thank you in advance.
    Ana

    The column width sizing rules are a little opaque. The column size is a function of things like the width that the DB thinks the column is (could be huge if a SQL function is being selected), the column name or heading width, the linesize (for very wide columns), any global format (e.g. SET NUMWIDTH), or the explicit COLUMN FORMAT.
    For consistency and portability I'd always recommend using an explicit COLUMN FORMAT. You can never tell if someone is going to run your report after previously setting a COLUMN FORMAT of the same name. Or a new database version may come out where the default datatype of a SQL function has changed. In the past this has happened when CHARs became the longer VARCHAR2s.
    I don't think Enterprise Manager's SQL Worksheet (a simplistic interface that just calls SQL*Plus in the background) is doing anything special for formatting. So COLUMN FORMAT will work fine.
    -- CJ

  • Xml output format in sql*plus problem

    Hi all,
    In stead of seeing xml output in multiple line format, my sql*plus always returns xml output in ONE line, is there a way to change the format, it's really hard to read.
    Thanks
    1 select xmlelement("row", xmlelement("user", xmlattributes(username as "name", default_tablespa
    2 from dba_users
    3* where rownum=1
    SQL>/
    XMLELEMENT("ROW",XMLELEMENT("USER",XMLATTRIBUTES(USERNAMEAS"NAME",DEFAULT_TABLES
    <row><user name="SYS" tbs="SYSTEM"></user></row>
    however I want to see something well formatted like
    <row>
    <user name="SYS" tbs="SYSTEM"></user>
    </row>

    Not sure if there are any settings with the SQL*PLUS but if you use packages other than the SQLX operators like DBMS_XMLQUERY, DBMS_XMLGEN, SYS_XMLGEN to generate xml then the output is as desired.
    select dbms_xmlgen.getxml('select username, default_tablespace from dba_users
    where rownum=1') from dual
    DBMS_XMLGEN.GETXML('SELECTUSERNAME,DEFAULT_TABLESPACEFROMDBA_USERSWHEREROWNUM=1'
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <USERNAME>REVIEW</USERNAME>
    <DEFAULT_TABLESPACE>METRICS</DEFAULT_TABLESPACE>
    </ROW>
    </ROWSET>
    But these packages does not offer the flexibility you have with SQLX operators.
    so if you requirement is simple generation you can use the above method.

  • Format problem in SQL/Plus 9.2

    In SQL/Plus 9.2 I am working with SET AUTOTRACE ON:
    explain-plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=11 Card=1 Bytes=52
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'BER_POSITION' (Cost=2 Ca
              rd=1 Bytes=20)
       2    1     NESTED LOOPS (Cost=11 Card=1 Bytes=52)
       3    2       NESTED LOOPS (Cost=10 Card=1 Bytes=32)
       4    3         NESTED LOOPS (Cost=9 Card=1 Bytes=25)
       5    4           NESTED LOOPS (Cost=8 Card=1 Bytes=21)
       6    5             INDEX (FULL SCAN) OF 'BEV_PK' (UNIQUE) (Cost=35
              Card=14439 Bytes=72195)
       7    5             TABLE ACCESS (BY INDEX ROWID) OF 'EAP_ERGEBNISSE
              ' (Cost=2 Card=1 Bytes=16)
       8    7               INDEX (RANGE SCAN) OF 'EE_VGNR_IDX' (NON-UNIQU
    ...I would like to have the following:
    explain-plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=11 Card=1 Bytes=52)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'BER_POSITION' (Cost=2 Card=1 Bytes=20)
       2    1     NESTED LOOPS (Cost=11 Card=1 Bytes=52)
       3    2       NESTED LOOPS (Cost=10 Card=1 Bytes=32)
       4    3         NESTED LOOPS (Cost=9 Card=1 Bytes=25)
       5    4           NESTED LOOPS (Cost=8 Card=1 Bytes=21)
       6    5             INDEX (FULL SCAN) OF 'BEV_PK' (UNIQUE) (Cost=35 Card=14439 Bytes=72195)
       7    5             TABLE ACCESS (BY INDEX ROWID) OF 'EAP_ERGEBNISSE ' (Cost=2 Card=1 Bytes=16)
       8    7               INDEX (RANGE SCAN) OF 'EE_VGNR_IDX' (NON-UNIQU
    ...I set linesize to 1000, but it has no effect.

    STFF [url http://forums.oracle.com/forums/click.jspa?searchID=6153770&messageID=1822302]Formatting output of execute plan in sqlplus

  • Formatting output columns - ala SQL*Plus 'column' command

    SQL_Developer 1.5
    Is there a way to format the output of queries for numbers, etc. like the 'column' command found in SQL*Plus?
    I realize I can use the TO_CHAR() function in the SQL but was hoping there was something easier.
    Thanks very much!
    -gary

    it could be that the column of the table that you are trying to insert the data has a small length.

  • How to represent time format AM/PM  in Oracle SQL Plus

    How do we represent time format (AM/PM) using SQL plus ? I'd like to get 09/01/2002 12:00 AM or 09/01/2002 12:30 PM displayed. Your inputs will help.
    Thanks

    Using either AM or PM will print out AM or PM
    example:
    SELECT to_char(sysdate,'hh24:mi:ss') ctime,
           TO_CHAR(SYSDATE,'hh:mi:ss AM') ctime_AM,
           TO_CHAR(SYSDATE,'hh:mi:ss PM') ctime_PM,
           TO_CHAR(SYSDATE-.1,'hh24:mi:ss') ctime2,
           TO_CHAR(SYSDATE-.1,'hh:mi:ss AM') ctime2_AM,
           TO_CHAR(SYSDATE-.1,'hh:mi:ss PM') ctime2_PM
    from dual
    RESULTS
    CTIME    CTIME_AM    CTIME_PM    CTIME2   CTIME2_AM   CTIME2_PM
    13:01:02 01:01:02 PM 01:01:02 PM 10:37:02 10:37:02 AM 10:37:02 AM

  • Help Using SQL*Plus Format Commands (like TTITLE) in Packages

    Where (within a package) can/should SQL*Plus format commands such as TTITLE, COLUMN & BREAK be coded?

    A package is coded in PL/SQL.
    TTITLE, COLUMN and BREAK are SQL*Plus commands, they cannot be used in PL/SQL.
    If you want to output data (using dbms_output) in your package, you'll have to implement the features yourself. But probably just using SQL*Plus is better in your case.
    Regards,
    Rob.

  • SQL * PLUS formatting issue

    Hi, Could anyone please tell me how to BREAK on multiple columns in SQL * PLUS.
    create table test (a number, b number, c number);
    insert into test values(1,2,5);
    insert into test values(1,3,5);
    insert into test values(2,2,6);
    insert into test values(2,3,6);
    Before formatting
    =============
    SQL> select * from test order by 1,3;
    A B C
    1 2 1
    1 3 1
    2 3 2
    2 3 2
    After formatting the result should be
    =========================
    A B C
    1 2 1
    3
    2 3 2
    3
    That means break on A,C and skip first record.
    I tried using "break on A,C skip 1", but its not working.
    Using SQL * PLUS to fire this formatting.
    Thanks.

    break on A,C and skip first record.
    I tried using "break on A,C skip 1", but its not working.
    Using SQL * PLUS to fire this formatting.
    Just one advice for you: RTFM
    SQL>
    SQL> desc test
    Name                                      Null?    Type
    A                                                  NUMBER
    B                                                  NUMBER
    C                                                  NUMBER
    SQL>
    SQL> select * from test order by 1, 3;
             A          B          C
             1          2          5
             1          3          5
             2          2          6
             2          3          6
    4 rows selected.
    SQL>
    SQL> break on a on c skip 1
    SQL>
    SQL> select * from test order by 1, 3;
             A          B          C
             1          2          5
                        3
             2          2          6
                        3
    4 rows selected.
    SQL>
    SQL>Note that, in your post, the results of your SELECT statement do not match the data inserted by your INSERT statement.
    pratz

  • Date Format in SQL*Plus

    How can I change SQL*Plus to run the statement:
    select * from t_1 where t_1.date_ini = '22-05-2001'
    Thank You

    I had this problem the other day and with a lot of toll and trouble I figured it out.
    select * from dual where to_date(t_1.date_ini,'DD-MM-YYYY') = '22-05-2001'
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Miguel Miqambres ([email protected]):
    How can I change SQL*Plus to run the statement:
    select * from t_1 where t_1.date_ini = '22-05-2001'
    Thank You<HR></BLOCKQUOTE>
    null

  • SQL*Plus formatting

    Can someone know how to configure login.sql to view data from SQL*Plus just like in standard MySQL output?

    as to the one column per line, I would recommend increasing your LINESIZE
    set linesize 1000
    to get the vertical bar between things
    set colsep |
    to force a row of underscores between each line
    set recsep each
    don't think we can do the "+"
    and I hope the lack of spaces (positional output) is due to the lack of "[ pre ]" tags in your post
    SQL> select * from words where rownum < 10;
    WORD                                                                   A N UPPER_WORD                             SEQ_NUM SOUN
    ARCADIAN                                                                   ARCADIAN                                     1 A623
    ARCHAEOLOGICAL                                                             ARCHAEOLOGICAL                               2 A624
    ARCHAEOLOGISTS                                                             ARCHAEOLOGISTS                               3 A624
    ARISTOTELIANS                                                              ARISTOTELIANS                                4 A623
    ARITA                                                                      ARITA                                        5 A630
    ARIZONA                                                                    ARIZONA                                      6 A625
    ARJUNA                                                                     ARJUNA                                       7 A625
    ARKANSAS                                                                   ARKANSAS                                     8 A625
    ARKWRIGHT                                                                  ARKWRIGHT                                    9 A626
    SQL>
    SQL>
    SQL> set linesize 1000
    SQL> set colsep |
    SQL> set recsep each
    SQL> /
    WORD                                                                  |A|N|UPPER_WORD                         |   SEQ_NUM|SOUN
    ----------------------------------------------------------------------|-|-|-----------------------------------|----------|----
    ARCADIAN                                                              | | |ARCADIAN                           |         1|A623
    ARCHAEOLOGICAL                                                        | | |ARCHAEOLOGICAL                     |         2|A624
    ARCHAEOLOGISTS                                                        | | |ARCHAEOLOGISTS                     |         3|A624
    ARISTOTELIANS                                                         | | |ARISTOTELIANS                      |         4|A623
    ARITA                                                                 | | |ARITA                              |         5|A630
    ARIZONA                                                               | | |ARIZONA                            |         6|A625
    ARJUNA                                                                | | |ARJUNA                             |         7|A625
    ARKANSAS                                                              | | |ARKANSAS                           |         8|A625
    ARKWRIGHT                                                             | | |ARKWRIGHT                          |         9|A626
    ------------------------------------------------------------------------------------------------------------------------------------

  • Can we use xml Publisher reporting for sql* Plus in EBS

    Hello All,
    The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format.
    So is it possible to use the xml reporting and make the output as Excel from the word template we design from MSword as we do for rdf(I have done few reports created in rdf to xml publisher reports in EBS and stand alone as well.).
    Do the same procedure will suit for Sql*Plus reports tooo or Is there any work around to achieve this.
    Thanks and Regards
    Balaji.

    Hi
    Thanks for the reply..
    I tried to do the follwoing
    1. changed the output to xml in the conc. prog.
    2. ran the same report but i am getting the follwoing error in the output file
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource
    Other reports which are using the Oracle Reports(rdf) as source, i am able to generated the xml as expected....
    So my question is whether we can use sql* reports executable and generate xml in the conc.prog.
    if any one has used the sql*reports for xml publisher reporting... please let me know, so that if its possible i will check my sql needs some validation or tuning...
    thanks in advance
    Balaji.

  • Got SQL *Plus query output in more than one in a single page

    Hi All,
    I have write a SQL *Plus code for execute one SQL query and registered as concurrent program. But I have got the output more than once in a single page after running the concurrent program. I am not getting what is the my code problem. Please can any one help me.
    This is my SQL code.
    -- These commands are added by applications concurrent manager
    SET TERMOUT OFF
    SET PAUSE OFF
    SET HEADING OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET ECHO OFF
    WHENEVER sqlerror exit failure
    -- set user environment
    SET pagesize 999
    SET linesize 860
    SET appinfo on
    SET tab off
    SET newpage none
    SET heading on
    --SET colsep ','
    -- define heading/footer
    --ttitle -
    -- left currdate -
    -- center 'SSFT Open PO Report' -
    -- right 'Page : ' format 999 sql.pno -
    -- skip 1 -
    -- center 'Organization US / Type Contract Labor / Status - Open' -
    -- skip 2
    --btitle -
    -- skip 1 -
    -- center 'Scansoft Inc. - All information confidential'
    -- define columns
    CLEAR columns
    SET heading on
    COLUMN c1 format a30 heading '"Last Name"' trunc
    COLUMN c2 format a30 heading '"First Name"' trunc
    COLUMN c3 format a50 heading '"Employee Name"' trunc
    COLUMN c4 format a20 heading '"Timecard Number"' trunc
    COLUMN c5 format a40 heading '"Expenditure Batch"' trunc
    COLUMN c6 format a24 heading '"Weekending Date"' trunc
    COLUMN c7 format a24 heading '"Expenditure Item Date"' trunc
    COLUMN c8 format a20 heading '"Expendtrmonth"' trunc
    COLUMN c9 format a20 heading '"Expendtryear"' trunc
    COLUMN c10 format a24 heading '"Sortdate"' trunc
    COLUMN c11 format 999999999 heading '"Task Id"'
    COLUMN c12 format a30 heading '"Task Name"' trunc
    COLUMN c13 format a30 heading '"Task Number"' trunc
    COLUMN c14 format a24 heading '"Closed Date"' trunc
    COLUMN c15 format a30 heading '"Project Name"' trunc
    COLUMN c16 format a30 heading '"Project Number"' trunc
    COLUMN c17 format a30 heading '"Project Status Code"' trunc
    COLUMN c18 format a30 heading '"Expenditure Type"' trunc
    COLUMN c19 format a30 heading '"Expenditure Org Name"' trunc
    COLUMN c20 format 999999999 heading '"Organization Id"'
    COLUMN c21 format a50 heading '"Projmrg"' trunc
    COLUMN c22 format a25 heading '"Role"' trunc
    COLUMN c23 format a24 heading '"Projmrg Start Date"' trunc
    COLUMN c24 format a24 heading '"Projmrg Start Date"' trunc
    COLUMN c25 format a35 heading '"Job Name"' trunc
    COLUMN c26 format a35 heading '"Project Type"' trunc
    COLUMN c27 format 999999999.99 heading '"Quentity"' trunc
    -- define breaks & computes
    --break -
    -- on report skip 2 -
    -- on c30 -
    -- on c20 skip 1
    --compute avg label 'Average' of c210 on report
    -- select statement here
    SELECT papf.last_name || '' c1, papf.first_name || '' c2,
    papf.full_name || '' c3, pea.orig_user_exp_txn_reference || '' c4,
    pea.expenditure_group || '' c5, pea.expenditure_ending_date || '' c6,
    peia.expenditure_item_date || '' c7,
    SUBSTR (TO_CHAR (peia.expenditure_item_date), 4, 3) || '' c8,
    SUBSTR (TO_CHAR (peia.expenditure_item_date), 8, 2) || '' c9,
    TO_DATE (SUBSTR (TO_CHAR (peia.expenditure_item_date), 4, 6),
    'MM/YY'
    || '' c10,
    peia.task_id || '' c11, pt.task_name || '' c12,
    pt.task_number || '' c13, ppa.closed_date || '' c14, ppa.NAME || '' c15,
    ppa.segment1 || '' c16, ppa.project_status_code || '' c17,
    pet.expenditure_type || '' c18, haou.NAME || '' c19,
    haou.organization_id || '' c20, pppv.full_name || '' c21,
    pppv.ROLE || '' c22, pppv.start_date_active || '' c23,
    pppv.end_date_active || '' c24, pj.NAME || '' c25,
    ppa.project_type || '' c26, peia.quantity || '' c27
    FROM pa.pa_expenditures_all pea,
    pa.pa_expenditure_items_all peia,
    pa.pa_tasks pt,
    pa.pa_projects_all ppa,
    hr.per_all_people_f papf,
    hr.hr_all_organization_units haou,
    pa.pa_expenditure_types pet,
    apps.pa_project_players_v pppv,
    hr.per_jobs pj
    WHERE pea.expenditure_id = peia.expenditure_id
    AND peia.task_id = pt.task_id
    AND peia.job_id = pj.job_id
    AND pt.project_id = ppa.project_id
    AND pea.incurred_by_person_id = papf.person_id
    AND pea.incurred_by_organization_id = haou.organization_id
    AND pet.expenditure_type = peia.expenditure_type
    AND ppa.project_id = pppv.project_id
    AND pppv.end_date_active IS NULL
    AND pea.expenditure_ending_date >= SUBSTR (SYSDATE - 545, 1, 9)
    ORDER BY papf.full_name ASC,
    pea.expenditure_ending_date ASC,
    peia.expenditure_item_date ASC;
    --spool off
    Thanks in advance
    --Subhas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi
    Either remove the semicolon (;) or the slash (/) at the end of your query, as both will execute it.

Maybe you are looking for

  • ASA 5505 Isolated Networks with Site-to-Site VPN Access

    I'm in the process of setting up an ASA 5505 for a remote site and needed some assistance determining if what I want to do is possible as well as if I need to upgrade the license from Base to Security Plus. Remote Site ASA 5505 Interfaces: Outside (I

  • Signed applet, jmf.jar provided, but no connection

    hi there! i'm posting this again in order for you to earn duke-bucks. i have a similar problem. i wrote an applet that connects to a video-streamserver an requests a live-stream. the applet sends some udp-packets to the server, which retreives the cl

  • HELP! MY PHONE WONT TURN ON

    I need help! My iPhone decided to shut off today with about 40% left. I have tried to plug it into the wall and a computer to maybe charge it (I even changed cords). It wouldn't respond. I have plugged it into my computer to see if iTunes would recog

  • URGENT: Motion JPEG?? Sequence problems

    HI I have a sequence that instead of having DV PAL in the settings has Motion JPEG A - will this be ok to go into DVDSP for a DVD video project??. This sequence has a few issues with frame size which I've made posts about and trying to rectify. In th

  • Import video to layers

    I open video from video frames to layers, it open easly but I hold the shift while select where I want.. problem is here.. while it's happening, too slow.. What should I do sorry for my bad eng