Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing variables to SQL procedure (AGAIN)

Status
Not open for further replies.

FlashGorden

IS-IT--Management
Nov 8, 2001
22
0
0
EU
Sorry to all those who answered my last problem on this matter.

What I wanted to know was why I could only pass variables containing only numbers from a korn shell program. If there were any letters in the variable then this message is displayed.

BEGIN find_record(2, ANI31500300.bad); END;
*
ERROR at line 1:
ORA-06550: line 1, column 23:
PLS-00201: identifier 'ANI31500300.BAD' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

I know this would work if I had single quotes round the variable but what I neglected to mention was that the korn shell procedure was in a for loop and I can't use the single quote sintax. The code from the shell is below.

sqlplus -s username/password << EOF
exec find_record($rec_no, $file)
EOF

Sorry and thanks in advance.
 
Double quotes allow the expansion but keep it to one variable (and I assume that's the problem?)

exec find_record(&quot;$rec_no&quot;, $file) Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top