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

Thread: output sqlplus command

  1. #1
    Join Date
    Jul 2001
    Location
    Montreal
    Posts
    222

    Question output sqlplus command

    Hi. I am trying to describe a table and include the command on output.
    (ie. DESC ECR.TABLE1 I would like to include the command on the output so I can have the tablename on the output..
    What setting do I need to turn on ? I tried various sqlplus settings, but nothing seems to do what I want. Please help thanks.

  2. #2
    Join Date
    Apr 2006
    Posts
    377
    The table name is included?

    Code:
    SQL> spool e:\test.log
    SQL> desc t1
     Name                                      Null?    Type
     ----------------------------------------- -------- -----------------------
     STR                                                VARCHAR2(2000)
    
    SQL> spool off
    
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Pr
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options
    
    E:\>type test.log
    
    SQL> desc t1
     Name                                      Null?    Type
     ----------------------------------------- -------- -----------------------
     STR                                                VARCHAR2(2000)
    
    SQL> spool off
    
    E:\>

  3. #3
    Join Date
    Jul 2001
    Location
    Montreal
    Posts
    222

    Question

    Hi. Your example works for 1 table.
    I have created a 'tables.sql' script which has 150 desc statements(the entire schema). The output displays the structure of all the tables and does not include the table name. I have not found a way to do this ? Anybody know how ?

  4. #4
    Join Date
    Apr 2006
    Posts
    377
    Put the following at the top of your script:

    Code:
    set echo on

  5. #5
    Join Date
    Jul 2001
    Location
    Montreal
    Posts
    222
    Its funny, but I tried that in SQLPLUS in OEM and it does not work.
    However, it does work in SQLPLUS command line.
    Thanks.

  6. #6
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818
    Try some variation on:

    SET LINES 150
    SET PAGES 100
    BREAK ON table_name

    SELECT table_name, column_name, data_type, data_length
    FROM all_tab_columns
    WHERE owner = ''
    ORDER BY 1


    and play with formatting the output as appropriate.

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