Home » Infrastructure » Unix » problems to execute an oracle stored procedure from Unix's shell
problems to execute an oracle stored procedure from Unix's shell [message #199802] Thu, 26 October 2006 04:28 Go to next message
istruttorenuoto
Messages: 5
Registered: October 2006
Junior Member
hi!
I have some problems to call a stored procedure from an Unix Script.

Here's the script

stty istrip
stty erase ^H
export ORACLE_BASE=/product/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.6
export PATH=$ORACLE_HOME/bin:/usr/ccs/bin:/bin:/usr/bin:/usr/local/bin:/usr/ucb
sqlplus user/password@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = IP_ADDRESS)(PORT = PORT_NUMBER)))(CONNECT_DATA =(SID = MYSID)))
@PROCEDURE_NAME
exit

Once having executed the script, i have a successfull connection message, but i have the follow message for the stored procedure:

SP2-0310: unable to open file "NOME_PROVEDURE.sql"

So i tried to write in the script the command "execute" instead of "@":

execute NOME_PROCEDURE

but i only have the successfull connection message and anything about the stored procedure's call. so i use toad to see if the stored procedure has worked, but nothing. i even tried with the exec command.

Could anyone give me any advice? Is there anything wrong in my Unix Script?
Thank You
Re: problems to execute an oracle stored procedure from Unix's shell [message #199810 is a reply to message #199802] Thu, 26 October 2006 05:12 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
sqlplus -s username/password@connectString <<EOF
execute your_procedure;
exit;
EOF
Re: problems to execute an oracle stored procedure from Unix's shell [message #212141 is a reply to message #199802] Wed, 03 January 2007 23:58 Go to previous message
bsureysh
Messages: 17
Registered: January 2007
Location: india
Junior Member
sqlplus -s username/password

exec schemaname.procedurename;

Try also like this ..!!
Previous Topic: Shell script to submit program to change password (FNDCPASS)
Next Topic: How to log into unix box through telnet from a batch file
Goto Forum:
  


Current Time: Thu Apr 18 01:35:48 CDT 2024