You Asked
Hi,
I have a sql file which will take schema name prefix as the parameter.This file in turn will call various sql files and all these files use this variable to do the job.
I execute this file like this:
sql> @execute_scripts.sql &&1
Enter the value of 1: (Here i give the schema name)
In another file I use a table name, so the code is as follows:
select * from &&1._crust.table_name;
Depending on the value of 1 it will go and access the table in that particular schema.
Now, my question is I want to write a batch file which will call all these sql files. How to pass this variable to this batch file so that it will be used in all these sql files. Please can someone give me some suggestions.
Many Thanks
and Connor said...
In windows:
myscript.bat
============
sqlplus @myscript %%1
In Unix
myscript.ksh
============
sqlplus @myscript $1
will let you pass a schema from the command line, and then onto SQL Plus
Is this answer out of date? If it is, please let us know via a Comment