Home » Infrastructure » Unix » shell script error - passing parameters to PL/SQL (merged)
shell script error - passing parameters to PL/SQL (merged) [message #302446] |
Mon, 25 February 2008 12:43  |
shree_z
Messages: 75 Registered: February 2008
|
Member |
|
|
Hi,
I am using Ksh script to read file name of a particualr pattern.. say P*.txt from a directory
I want to use the the filename to be sent as parameter to a concurrent program which is in turn called by a procedure which uses FND_REQUEST.SUBMIT_REQUEST.
Please help,
|
|
|
|
|
|
shell script error [message #303488 is a reply to message #302446] |
Fri, 29 February 2008 09:39   |
shree_z
Messages: 75 Registered: February 2008
|
Member |
|
|
I am running the below shell script and getting some errors
Quote: | #!/bin/ksh
echo "=================================================="
echo "Beginning program " `date "+%m/%d/%y %H:%M:%S"` "\n"
echo "================================================="
datadir="/path/data";
archdir="/path/archive";
cd $datadir
ls -lrt A*.txt | awk '{print $9}' | while read fname
do
echo The file to be passed to importing program is $datadir/$fname
RETVAL='sqlplus -s apps/apps4you@GAMDEV << EOF
set serveroutput on
declare
fname := $fname;
datadir := $datadir
request_id number(30);
status varchar2(30);
phase varchar2(30);
begin
XX_Call_Import_Prgm(fname,datadir,request_id,status,phase);
dbms_output.put_line ('Values_are '|| request_id ||' '|| status ||' '|| phase);
end;
/
exit;
EOF'
STATUS= echo $RETVAL | grep Values_are | awk '{print $2}'
PHASE= echo $RETVAL | grep Values_are | awk '{print $3}'
echo status=$STATUS
echo phase=$PHASE
if [[$PHASE='Completed' -a $STATUS='Normal']]; then
echo Import Successful
mv $fname $archdir
else
echo Import Not Successful
fi
done
echo "=================================================="
echo "Ending program " `date "+%m/%d/%y %H:%M:%S"` "\n"
echo "=================================================="
|
The errors are as follows;
Quote: | || request_id ||: not found
status=
phase=
[[=Completed: not found
|
The pl/sql procedure which this shell script calls, is executing fine even though it takes long..What could be the reason behind these errors?
Thanks in advance
[Updated on: Fri, 29 February 2008 10:03] Report message to a moderator
|
|
|
|
|
Re: shell script error [message #303503 is a reply to message #303493] |
Fri, 29 February 2008 10:48   |
shree_z
Messages: 75 Registered: February 2008
|
Member |
|
|
Thank you Thomas,
Now the error "request_id not found" is fixed.
But I still get the output as
status=
phase=
[=Completed: not found
Can you please give me the corrections needed in the script?
Thank you so much for your advice.
[Updated on: Fri, 29 February 2008 10:51] Report message to a moderator
|
|
|
|
|
Re: shell script error [message #303560 is a reply to message #303541] |
Fri, 29 February 2008 14:46  |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
I could help you if you had a specific question about a specific problem, but I don't have time to fix every single syntax error you encounter one by one.
|
|
|
Goto Forum:
Current Time: Fri May 02 04:50:40 CDT 2025
|