Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Plus Formatting 1

Status
Not open for further replies.

marjac

Programmer
Jun 19, 2001
7
US
I am creating a CSV file and am using an input value in SQL Plus to select data.

(AND SCHYEAR = SUBSTR('&SCHYEAR',6,4);)
selects the end of a school year input like ‘2003-2004’

I have
set echo off
set serveroutput on size 1000000
set linesize 300
set heading off
set feedback off

but I still get
Enter value for schyear: 2003-2004
old 21: AND SCHYEAR = SUBSTR('&SCHYEAR' 6 4);
new 21: AND SCHYEAR = SUBSTR('2003-2004' 6 4);
in the first 3 lines of the CSV file.

Does anyone know how I format SQL Plus so these 3 lines do not show up in the CSV file?
 
I assume from this you still want to prompt the user for a value for SCHYEAR? Try this:

[tt]set echo off
set serveroutput on size 1000000
set linesize 300
set heading off
set feedback off

ACCEPT SCHYEAR PROMPT "Enter the SCHYEAR "

spool yourfile

SELECT yoursql
FROM yourtable
WHERE something = '&SCHYEAR';

spool off[/tt]
 
Thanks for responding so quickly lewisp...it worked, Yay!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top