Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Parameters with spaces
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
![]() |
![]() |