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!

sql script called by unix scripts

Ash_Feb 15 2010 — edited Feb 15 2010
Hi,

I am running a sql script from shell script. I have tried it the following ways:
1. sqlplus -s usr/pwd@sid @my_sql_script.sql

2. sqlplus -s usr/pws@sid <<!eof
@my_sql_script.sql
exit;
!eof

The sql script has 2 binary variables defined using && as below:
variable x number;
begin
:x :=&&Enter_the_number;
end;
/

Option 1 above works fine and prompts for the value of Enter_the_number. But when I run it using option2 the script does run but fails over midway.
The error message is 'User requested Interrupt or EOF detected.'

I am not sure what is the reason behind it. Could anyone please help me out with this. Many thanks in advance!

Thanks!

Edited by: Ash_ on Feb 15, 2010 2:33 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2010
Added on Feb 15 2010
6 comments
984 views