Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlplus & unix
Hi Kevin,
No. For the script shown you drop the first two lines and substitute the desired value on the right side of the equal sign in the where clause.
If you want the ability to enter the value at run time you can drop the first two lines and substitute $1 for $variable. You will then be able to enter the name of the script followed by one or more spaces followed by the value you want used. (In unix shells $1 is the first parameter, $2 the second parameter, and so on).
regards
Jerry Gitomer
Kevin Connors wrote in message <379613BF.6AEA240D_at_merck.com>...
>Does the UNIX variable need to be exported in order to be used
in an
>Oracle SQL query?
>
>I am new to UNIX and Oracle and need to modify some shell
scripts that I
>have inherited.
>
>Thanks in Advance!!!!
>
>Iancrozier wrote:
>>
>> You can run sqlplus inside a unix shell e.g.
>> #!/bin/sh
>> variable=3
>> export variable
>> sqlplus -s username/password_at_instance << EOSQL
>> select * from table
>> where column = $variable
>> /
>> EOSQL
>
>
> The contents of this message express only the sender's
opinion.
> This message does not necessarily reflect the policy or
views of
> my employer, Merck & Co., Inc. All responsibility for
the statements
> made in this Usenet posting resides solely and completely
with the
> sender.
Received on Thu Jul 22 1999 - 07:36:17 CDT
![]() |
![]() |