General
cancel
Showing results for 
Search instead for 
Did you mean: 

problem running scrip in unix at sqlplus

Cathy Arora
Frequent Advisor

problem running scrip in unix at sqlplus

Thanks all,
I already had changed the permissions
However i added the location of my script with in the script and still I get the same error
and script looks like this (just for test)
name of the script whoami

cd /home/kchinsky/scripts
show user
select * from global_name
exit

I logon to sqlplus
user/pasword
@whoami
and I get
SP2-0310: unable to open file "whoami.sql"
any help is appreciated
raj
5 REPLIES
Anna Fong
Advisor

Re: problem running scrip in unix at sqlplus

@/home/kchinsky/scripts/whoami

To not have to specify whole path, put your script path in your PATH env.

Also, mixing UNIX commands in your SQL will generate errors.
Yogeeraj_1
Honored Contributor

Re: problem running scrip in unix at sqlplus

hi,

also make sure that the script name is whoami.sql

can you post the output of:
SQL> ! ls -al w*.sql

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Arturo Galbiati
Esteemed Contributor

Re: problem running scrip in unix at sqlplus

@/home/kchinsky/scripts/whoami

and I suggest you to change

cd ....

with

!cd ....

to avoid any error.

Art
T G Manikandan
Honored Contributor

Re: problem running scrip in unix at sqlplus

anyfile you run with sqlplus I prefer it to rename it to <script>.sql

#mv whoami to whoami.sql

$sqlplus @database
sql@whoami


REvert
Jean-Luc Oudart
Honored Contributor

Re: problem running scrip in unix at sqlplus

The original post is here
(with the solution but ... no rabbit)

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=246948

Rgds,
JL
fiat lux