Home » Infrastructure » Unix » calling sqlplus, sending variable to input a function
calling sqlplus, sending variable to input a function [message #498611] Thu, 10 March 2011 08:56 Go to next message
nichollsvi
Messages: 8
Registered: May 2009
Location: Va.
Junior Member
Hi,

Having a problem here. I'm on Linux/RHEL 5. I'm trying to get a script to work and I receive no error messages, but it doesn't work.

All I am doing is calling my Unix script with several variables ($1, $2, $3, $4). I get into Sqlplus. At that point, I want to set a variable with the outcome of a function call & my Unix variable. However, the system never updates. Any ideas? All the ideas I've seen so far suggest this should work OR they put all this in another sql script and call it. We really need to not add another script on top of that.

Any ideas? Thanks,

Vic


LOAD_WEEK=$4
export LOAD_WEEK

sqlplus /nolog <<EOF

connect odumgr/$2@$1

declare
RetVal DATE;
begin
RetVal := odumgr.f_ods_et_hist($LOAD_WEEK);
update odu_enrollment_tracking_vic
set cube_created = RetVal;
commit;
end;
exit;

EOF
Re: calling sqlplus, sending variable to input a function [message #498614 is a reply to message #498611] Thu, 10 March 2011 09:10 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
LOAD_WEEK=$4

Get rid of $.

Re: calling sqlplus, sending variable to input a function [message #498709 is a reply to message #498614] Thu, 10 March 2011 20:41 Go to previous messageGo to next message
nichollsvi
Messages: 8
Registered: May 2009
Location: Va.
Junior Member
Actually it worked as '$4'.

Victoria
Re: calling sqlplus, sending variable to input a function [message #498711 is a reply to message #498709] Thu, 10 March 2011 20:49 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I'm trying to get a script to work and I receive no error messages, but it doesn't work.
>Actually it worked as '$4'.
Please make up your mind (& ours).

What is $3?

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Previous Topic: vi editor
Next Topic: oracle Installation on AIX
Goto Forum:
  


Current Time: Thu Mar 28 09:46:08 CDT 2024