Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

use file as sql*plus input

user8647520Oct 28 2010 — edited Oct 28 2010
Can I use a file as sql*plus input?

I have a query like below:

select * from employees
where deptno = &1
and job = &2
/

It will prompt me for the values of course.

I can execute it at the command line like below:

sql>@script.sql 10 salesrep

Is is possible to put the values in a file and call the script like below:

sql>@script.sql <filename>



Then this file could be in a directory in the OS and I can add any values to it.

thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2010
Added on Oct 28 2010
4 comments
7,809 views