Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Passing String Arguments to SQL*Plus from a Unix Shell

Re: Passing String Arguments to SQL*Plus from a Unix Shell

From: A. Coskan Gundogar <gundogar_at_gmail.com>
Date: Thu, 29 Mar 2007 14:06:35 +0300
Message-ID: <d1f742de0703290406k3288db5aode439724169a48e0@mail.gmail.com>


Maybe Tom Kyte could help you with his article on last issue of the OraMag

It is about varying in lists

http://www.oracle.com/technology/oramag/oracle/07-mar/o27asktom.html

On 3/29/07, Uwe Küchler <uwe_at_kuechler.org> wrote:
>
> Hi all,
>
> I've scanned this list and other forums but haven't found a satisfying
> answer so far:
> I need to pass arguments containing the SQL string delimiter "'" to
> sqlplus from a shell script, e.g.:
>
> sqlplus user/pass @my.sql $1
>
> where $1 should be like "'1','2','3'", so that a SQL statement WHERE
> clause within the script can be modified like this:
>
> define inlist=&1
> ...
> SELECT something FROM mytable
> WHERE something NOT IN ( &inlist );
>
> -->
> WHERE mycol NOT IN ( '1','2','3' );
>
> I know how to pass arguments/parameters without the "'", but when I use
> "'" it gets erased by the shell. I've tried to escape the "'" but with no
> success so far.
> It looks so simple but I can't find a solution. *help*
>
> Regards,
> --==/ Uwe \==--
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

-- 
A. Coskan GUNDOGAR

Oracle DBA

http://coskan.wordpress.com

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 29 2007 - 06:06:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US