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

4

24

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?

Thomasson answered 7/4, 2011 at 6:27 Comment(0)
S
45

SET NEWPAGE NONE is the correct answer.

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

Slattery answered 10/10, 2011 at 23:24 Comment(2)
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.Airlike
Best bet is to select your own header because SQLPLUS is not good at formatting headers.Proudfoot
A
1

FYI set newpage does nothing if using set markup csv on. Set markup csv on creates an LFCR at the beginning of the file which excel uses and adds a blank row.

Advisee answered 27/7, 2023 at 14:45 Comment(0)
P
0

Working in TOAD, set newpage none didn't work for me. I still had an empty row between the header and the data. However, when I removed set trimspool on, the empty row went away.

Plagiarize answered 24/1, 2024 at 17:9 Comment(0)
T
-1
SET NEWPAGE 0

see here

Thomasson answered 7/4, 2011 at 8:37 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.