Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do you pass a value from a shell script into a sqlplus script?
True, &1 &2 &3 etc. is the way to get the command line parameters into
the sqlplus script, but if your script is anything other than trivial
I'd recommend defining substitution variables with MEANINGFUL names,
copy the parameters into them, and then only use the named variables
throughout your script. Very difficult to work on a long script which is
littered with numeric parameter names.
e.g.
DEFINE P_USER_NAME = "&1" DEFINE P_START_DATE = "&2" DEFINE P_DATE_FORMAT = "&3"
Martin
isa wrote:
>Hi:
>
>In the shell script: @fichero.sql PARAM1 PARAM2 PARAM3
>
>In the sql: where field1 = '&1' and field2 = '&2' and field3 = &3
>
>where parameters 1 and 2 are character and the 3 is numeric.
>
>Regards,
> Isa
>
>"Mike J" <mjjwestford_at_hotmail.com> escribió en el mensaje
>news:ur885v82jtbt45_at_corp.supernews.com...
>
>
>>I gather parameter values in a korn shell script and want to use them in a
>>sqlplus script that is called from the shell script. How do you pass a
>>
>>
>value
>
>
>>into the sqlplus script?
>>
>>
>>
>>
>
>
>
>
Received on Mon Oct 21 2002 - 13:10:46 CDT
![]() |
![]() |