Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQl Help - use of special characters in a script when sending a password
in the login.sql, bracket the connect line with
set scan off
and
set scan on
The sqlplus command "set scan" controls whether sqlplus looks for the defined substitution character.
On 7/7/05, Henslee, Jeff <jhenslee_at_wausauwindow.com> wrote:
> Apologies for the simple question - but I'm having a total brain fart.
> ======
> Oracle 8.1.74 and Solaris 8
> I have a file which I use in scripts to connect as a certain user. They are set to be available to only the oracle user and members of the dba group.
>
> basically, they are hidden files and called:
> .<username>.login.sql
> and contain:
> connect username/password
>
> when I execute sqlplus I use:
> $ sqlplus -s /nolog @.<username>login.sql
>
> My problem is that I have a user password that contains a '&' character.
>
> (Example:)
> connect username/Blob21&vb02
>
> How can I code in the '&' character into my script and NOT have sqlplus think it is a variable? Anybody ever run into this?
>
> I know that in SQL you can use something like:
>
> select field1, field2
> from foo
> where code like '%\_%' escape '\'
>
> How can I do it in a password (file) in my example?
>
> Please advise.
>
> Many Thanks!
>
> Jeffrey C. Henslee
> mailto:jhenslee_at_wausauwindow.com
>
> --
> http://www.freelists.org/webpage/oracle-l
>
-- Paul Baumgartel paul.baumgartel_at_aya.yale.edu -- http://www.freelists.org/webpage/oracle-lReceived on Thu Jul 07 2005 - 15:29:44 CDT