Skip to Main Content

SQL & PL/SQL

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!

Not able to Loop a sql query in shell script

980455Dec 18 2012 — edited Dec 18 2012
Hi, I am not able to loop a sql query i am reading data from file replacing the part no in the where clause of query.

FILENAME=$1
while read LINE
do
VALUE=$LINE
echo "NAME $VALUE"
sqlplus -s wcadmin/wcadmin@wctest98 <<EOF
select ida2a2,name from REPORT where ida2a2=$VALUE;
EOF
echo "done"
done < $FILENAME

I am getting a Error: Syntax error at line 10 : `done' is not expected which done < $FILENAME i am using c shell.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2013
Added on Dec 18 2012
6 comments
1,938 views