Re: Dynamic variables within unix script file...
Date: 12 Jan 1994 00:40:49 GMT
Message-ID: <2gvguh$17q_at_marlin.ssnet.com>
In article <Brian.Sakach.5.000D880F_at_DaytonOH.NCR.COM>, Brian.Sakach_at_DaytonOH.NCR.COM (Brian Sakach) writes:
|>
|> >Simply changing the line containing your select statement to:
|> >select * from table_name where emp_num = $1;
|> >should do the trick. The Unix shell will substitute the $1 with the
|> >first parameter you give in, before passing the command to SQL*Plus.
|>
|>
|> What do you do if the parameter you pass is text with embedded
|> spaces and the number of spaces varies. For instance, the input
|> might be 1 to 5 words for a 'name' parameter...
|>
|> George Earl Jones
|> George Jones
|> George Earl Jones, III
|> ** Brian.Sakach_at_DaytonOH.NCR.COM **
Passing blank delimited parameters from the shell can get fairly tricky depending on the number of scripts and layers involved. If is you were to invoke sqlplus as follows I believe you will have joy
sqlplus <ora login> _at_script.sql "this is p1" "this is p2"
-- Thanks, -------------------------------------------------- joseph r minnich jminnich_at_bugaboo.ssnet.com 724 millcreek lane home: (302)322-6244 bear delaware 19701 work: (302)368-8982Received on Wed Jan 12 1994 - 01:40:49 CET