Home » RDBMS Server » Server Utilities » i need to pass the argument to the (spool_file.sql) sql file such as "d:\gopal\spool.lst"
i need to pass the argument to the (spool_file.sql) sql file such as "d:\gopal\spool.lst" [message #154150] Thu, 05 January 2006 23:28 Go to next message
cgk_js
Messages: 48
Registered: December 2005
Member
the following sqlplus statement is contained in the unix shell script.

sqlplus $CONNECT @$EXTRACTDIR/gopal/spool_file.sql

The spool_file.sql defines the spooling and selecting from exp_tables.

spool d:\gopal\spool.lst
select * from exp_tables;

i need to pass the argument to the (spool_file.sql) sql file such as "d:\gopal\spool.lst", how can i do it.

pls help on this.
Re: i need to pass the argument to the (spool_file.sql) sql file such as "d:\gopal\spool.lst&a [message #154161 is a reply to message #154150] Fri, 06 January 2006 00:32 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member

sqlplus @$EXTRACTDIR/gopal/spool_file.sql argument1 argument2 ....


for e.g. in your case

sqlplus @$EXTRACTDIR/gopal/spool_file.sql d:\gopal\spool.lst

 and inside spool_file.sql

 spool &&1  <--- here 1 represents first argument
select * from exp_tables;

[Updated on: Fri, 06 January 2006 00:32]

Report message to a moderator

Re: i need to pass the argument to the (spool_file.sql) sql file such as "d:\gopal\spool.lst&q [message #154227 is a reply to message #154150] Fri, 06 January 2006 05:42 Go to previous message
cgk_js
Messages: 48
Registered: December 2005
Member
Thanks
Previous Topic: migration from oracle to db2?
Next Topic: export an pipe to a zip file
Goto Forum:
  


Current Time: Tue Jul 02 04:13:48 CDT 2024