Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to pass a parameter to SQL from shell script loops

AppsGMPMar 15 2011 — edited Mar 16 2011
Hi All,
I am new to Unix commands. I got one requirement to pass parameter to SQL from shell script. I am able to pass the parameter if there is no loops. But inside the loops i tried to pass the parameter, but it is passing null values. My code as follows.

for FILENAME in `ls $P_FILE_PREFIX*`; do
FILE=`ls $FILENAME`
FCP_LOGIN='apps/apps'
P_RESP_NM=`sqlplus -s apps/apps<< START
SET HEADING OFF
SELECT '"'||responsibility_name||'"'
FROM fnd_responsibility_vl
WHERE responsibility_id = (SELECT responsibility_id
FROM fnd_concurrent_requests
WHERE ARGUMENT2=*$FILENAME*); EXIT START`

Here the parameter $FILENAME returns null. Anybody can suggest me what i missed.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2011
Added on Mar 15 2011
4 comments
4,644 views