Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005

    Unanswered: SQLPLUS Formatting

    I am a novice user of SQLPlus and want to qry a file and output only the resulting records but not the columns and formatting etc. My qry outputs results to a file but also echos the commands and column headings - I just want the records and nothing else so that I can process the file.

    Can anybody help.

  2. #2
    Join Date
    Jun 2004
    Provided Answers: 1
    I assume you're using the 'spool' command, in which case I don't know if there's a way to stop your SQL being recorded in the output file.

    You can supress the column headings by using the command:

    set head off

    To supress the 'Total Number of Records' message at the end of your output use:

    set feedback off
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

  3. #3
    Join Date
    Apr 2003
    Greenville, SC (USA)
    Depending on how you want to process the file (ie, tab / comma delimited)
    here's an example ...

    /************************************************** *********/
    /* Example of how to create an ASCII delimited file */
    /* chr(9) will insert a tab between columns in output */
    /* Set the linesize to the correct length of the row */
    /************************************************** *********/

    set linesize 120
    set header off
    set pagesize 0
    set feedback off
    set trimspool on

    spool c:\test.txt

    select username||chr(9)||sid||chr(9)||serial#||chr(9)||pr ogram from v$session;

    spool off


Posting Permissions

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