Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    25

    Unanswered: When I use "SET HEADING OFF" I lose Column Headers

    I am spooling data from query to a .txt file to be imported into Excel. Query is something like this:

    SET HEADING OFF
    SET PAGESIZE 0...

    SPOOL D:\sampleout.txt

    SELECT
    manufacturer AS mfr,
    model AS ver,
    lastinv - firstinv AS DaysInstalled...
    FROM
    product
    WHERE ....

    SPOOL OFF

    Without the "HEADING OFF" statement, I get the "SELECT" statement in my output file. With the "HEADING OFF" statement, I lose my Column Headers.

    How do I not echo the select statement to outfile but keep my column headers?

    Thanks.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    SET PAGES 0 will also prevent printing the headers.
    To not have your SQL in the output do:
    Code:
    set feed off ver off echo off term off pages 0 trims on

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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