Home » Infrastructure » Unix » calling procedure in shell script (merged)
calling procedure in shell script (merged) [message #411724] Mon, 06 July 2009 08:15 Go to next message
arjunyadav
Messages: 15
Registered: September 2008
Junior Member
Dear all,
I have attached text file of my issue.
Kindly get it and guide me.

Thanks and Regards
Arjun
  • Attachment: script.txt
    (Size: 1.16KB, Downloaded 2031 times)
Re: calling procedure in shell script [message #411725 is a reply to message #411724] Mon, 06 July 2009 08:16 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Your file is 1.16 Kb. Why did you not just post it? I personally just ignored it.
Re: calling procedure in shell script [message #411727 is a reply to message #411725] Mon, 06 July 2009 08:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So do I and the issue in the title has been adressed so many times that I don't even to make the effort to have a look at any file.

Regards
Michel
calling procedure in shell script [message #411728 is a reply to message #411724] Mon, 06 July 2009 08:25 Go to previous messageGo to next message
arjunyadav
Messages: 15
Registered: September 2008
Junior Member

Dear all,

I have a shell script file e_payment.sh.
I have one file e_payment.txt which is having records.I want to pass the records one by one in database.

Commands in e_payment.sh file are as follows:

-------------------
for file_row in `cat /home/oracle/bcs/e_payment.txt`
do
export file_record=$file_row
sqlplus -silent ltbill/ltbill@mgclnbil @exec_procedure.sql >> e_payment_error.log
done
------------------


And I have one file exec_procedure.sql contents are as follows:

-----------------
exec E_PAYMENT_FILE_DOWNLOAD($file_record)
exit
-----------------


all the file file e_payment.sh and exec_procedure.sql and e_payment.txt I have put in same directory.

I want to pass the value of variable 'file_record' as parameter in my prcedure E_PAYMENT_FILE_DOWNLOAD
which has been called in exec_procedure.sql file.

But I get the message like:

ERROR at line 1:
ORA-06550: line 1, column 31:
PLS-00181: unsupported preprocessor directive '$FILE_RECORD'.

I am not very experienced with scripting but I need resolution on high requirement.
Please guide me how can I pass the value of variable in procedure.

Thanks and Regards
Arjun
Re: calling procedure in shell script (merged) [message #411748 is a reply to message #411724] Mon, 06 July 2009 09:47 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
for file_row in `cat /home/oracle/bcs/e_payment.txt`
do
export file_record=$file_row
sqlplus -silent ltbill/ltbill@mgclnbil << EOF
exec E_PAYMENT_FILE_DOWNLOAD($file_record)
exit
EOF
done
Re: calling procedure in shell script (merged) [message #426594 is a reply to message #411724] Fri, 16 October 2009 15:49 Go to previous message
scripter
Messages: 6
Registered: October 2009
Location: India
Junior Member
Change the below line

for file_row in `cat /home/oracle/bcs/e_payment.txt`

as

cat /home/oracle/bcs/e_payment.txt | while read file_row

You issue will be solved.

Regards,
Scripter
Previous Topic: cron job not getting executed
Next Topic: Grep to get previous line
Goto Forum:
  


Current Time: Fri Mar 29 09:36:39 CDT 2024