Results 1 to 4 of 4

Thread: SQL*Plus info

  1. #1
    Join Date
    Jan 2003
    Posts
    6

    Unanswered: SQL*Plus info

    Hello everyone.. I'm doing some scripting through SQL Plus and I had this query (which I forgot to save) that created teh following Header before each row:


    INFO_1
    --------------------------------------------------
    INFO_2
    --------------------------------------------------
    INFO_3 APRF
    -------------------------------------------------- --------------
    MESSAGE_DATE
    -------------------

    Which looks like it cuts the column off at 81.. And it puts this BEFORE each record.. this is what I want.. but now.. it's doing:



    INFO_1
    --------------------------------------------------
    INFO_2
    --------------------------------------------------
    INFO_3 APRF MESSAGE_DATE
    -------------------------------------------------- -------------- -------------------


    Which as you can see is not cutting, and it's also only doing that on PAGE break.. I'ms ure it's something with the SQL (Which is included)
    Any help would be GREAT.. Thanks

    select info_1,info_2, info_3, aprf, message_date
    from aibridge_text_message
    where
    message_date >= '01/01/2003 00:00:00'
    and message_date <= '01/30/2003 23:59:59'
    order by info_1, message_date

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: SQL*Plus info

    Looks like you need SET PAGESIZE <number> LINESIZE 80 to format the output.

    You can also use COLUMN command:

    COLUMN message_date NEWLINE
    Last edited by andrewst; 01-22-03 at 13:43.

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: SQL*Plus info

    You might be interested in Tom Kyte's PRINT_TABLE code, which prints query output in a vertical format like this:

    SQL> @print_table "select * from emp where deptno = 10"
    EMPNO : 7782
    ENAME : CLARK
    JOB : MANAGER
    MGR : 7839
    HIREDATE : 09-jun-1981 00:00:00
    SAL : 2450
    DEPTNO : 10
    AGE : 42
    -----------------
    EMPNO : 7839
    ENAME : KING
    JOB : PRESIDENT
    HIREDATE : 17-nov-1981 00:00:00
    SAL : 5000
    DEPTNO : 10
    AGE : 42
    -----------------
    EMPNO : 7934
    ENAME : MILLER
    JOB : CLERK
    MGR : 7782
    HIREDATE : 23-jan-1982 00:00:00
    SAL : 1300
    DEPTNO : 10
    AGE : 42
    -----------------

    PL/SQL procedure successfully completed.

    (The data column lines up nicely in reality!)

    If interested, go to asktom.oracle.com and search for PRINT_TABLE.

  4. #4
    Join Date
    Jan 2003
    Posts
    6
    WOW.. thanks guys.. I'll definately checkout that Script..

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •