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: Parameters with spaces

Re: Parameters with spaces

From: Jared Still <jkstill_at_bcbso.com>
Date: Fri, 28 Apr 2000 17:10:19 -0700 (PDT)
Message-Id: <10481.104498@fatcity.com>


This works for me:

  sqlplus jkstill/PASSWORD_at_dv05 @x.sql "'this is a test parameter'"

x.sql consists of:

        select '&1' from dual;

Jared

On Thu, 27 Apr 2000, Bill Becker wrote:

> I know that you can pass env vars from unix to sqlplus via:
> sqlplus name/password @file "$VAR1"
>
> In the called script, the value of $VAR1 can then be referenced
> as '&1'. This works fine, except when $VAR1 is an expression containing
> multiple strings separated by spaces; then '&1' is interpreted as
> only the first string, up to the first space. The number of
> strings in the expression is variable, and the '&1' is used in the
> script in a WHERE clause: WHERE FIELD1 = '&1';
>
> Does anyone know of a way to pass an expression from the unix shell
> to sqlplus, preserving all strings and spaces within the expression?
>
> On Solaris 2.7, Oracle 8.1.6
>
> Thanks to any who reply
> beckerb_at_dgabby.mfldclin.edu
> --
> Author: Bill Becker
> INET: beckerb_at_dgabby.mfldclin.edu
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;-) Regence BlueCross BlueShield of Oregon
jkstill_at_bcbso.com - Work - preferred address Received on Fri Apr 28 2000 - 19:10:19 CDT

Original text of this message

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