DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: formating sql

  1. #1
    Join Date
    Jan 2001
    Posts
    216
    Hi,

    Whenever, I select rows from our tables, the results are very hard to read as they get wrapped over several lines. Is there a way by which we can format all the columns in them to a more treadable format ? like trim the varchars.

    I am looking for a script for eg called setTableFormat.sql. Just before I select data from tables, in sql prompt, I can call this script. The script must be a generic one for all tables, I do not want to specify the column names there.

    Thanks in advance for all your help
    Neelima

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Check sql reports on how to do it.

    SQL> ? set

    This would list you the different set options that you could use in the query formatting. Hope this would help you,
    Sam

    [Edited by sambavan on 03-19-2001 at 03:23 PM]
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Feb 2001
    Posts
    203
    set heading off
    spool tab_rowcount.sql
    select 'select '''||table_name||'---''||count(*) from '||table_name from user_tables;
    spool off;
    spool tab_row_info.txt
    @tab_rowcount.sql
    spool off;

    This will give you the tables row count from user_tables. Other way is analyze the tables and it will give you the tables row count.
    sree

  4. #4
    Join Date
    Mar 2001
    Posts
    6
    Hi,

    column c1 format t1 - is a formatting command.

    where c1 is a column name and
    t1 is datatype and width eg(a16)--char with 16 bytes in length.

    Thanks.

    M.S.Nazar

  5. #5
    Join Date
    Feb 2001
    Posts
    125
    you can inclue set linesize command.


    SQL> set linesize 1000

    then run you select command.


    thnx

    P. Soni


Posting Permissions

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


Click Here to Expand Forum to Full Width