sqlplus spooling: How to get rid of first, empty line?

45,232

SET NEWPAGE NONE is the correct answer.

SET NEWPAGE 0 will cause a page feed, which is not what the OP wants.

Share:
45,232

Related videos on Youtube

Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm doing the following spooling statement:

    SET VERIFY OFF
    SET FEEDBACK OFF
    SET HEADING OFF
    SET TRIMSPOOL ON
    SET TERM OFF
    SPOOL &pathRelations
    START scripts/relations.sql &parent
    SPOOL OFF
    SET TERM ON
    

    The scripts/relations.sql file contains a simple select statement.

    Unfortunately, the spooled file contains an empty line as the first one in the file. This line causes trouble in our framework.

    Of course I could get rid of these line through sed but ain't there a way to suppress its creation in the first place?

  • bitoolean
    bitoolean over 5 years
    Neither worked for me. Thanks anyway! However, setting heading to OFF will get rid of the empty line at the beginning at least, but I need the heading.
  • alexherm
    alexherm about 4 years
    Best bet is to select your own header because SQLPLUS is not good at formatting headers.