Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Passing pameter which has spaces sqlplus
abhijitbhosale_at_hotmail.com (Abhijit Bhosale) wrote in message news:<c7d01eb4.0301221041.755658ab_at_posting.google.com>...
> Hi,
> I want to execute the following command on 9i Server
>
> sqlplus -S /NOLOG @ora.sql "sys/change_on_install_at_ORAID1 as sysdba"
>
> Since 9i allows sys user login only if it's connected as sysdba or
> sysoper.
> So the paramater I want to pass should have the 'as sysdba' part.
> Now I want this parameter to be passed to the script ora.sql.
>
> My pboblem is, when I use Oracle 8i sqlplus client to execute the
> above command, it works only if I put the '\' as the escape chrater
> before ".
> e.g.
> sqlplus -S /NOLOG @ora.sql \"sys/change_on_install_at_ORAID1 as sysdba\"
>
> And if I run using Oracle 9i sqlplus client, it works without using
> the '\'
> as escape charater.
>
> e.g.
> sqlplus -S /NOLOG @ora.sql "sys/change_on_install_at_ORAID1 as sysdba"
>
> I want same command to be executed with both the sqlplus clients.
> How can I do that?
>
>
> I found one command, "SET ESC ON", which sets the '\' as the escape
> charater.
> Will it be useful in this case? How can I use it?
>
> Thanks,
> Abhijit
Put connect string first thing inside your file. sqlplus -s /nolog @ora.sql
and first thing in your file,
connect sys/change_on_install_at_ORAID1 as sysdba
Works on both 8 and 9i.
Regards
/Rauf Sarwar
Received on Wed Jan 22 2003 - 21:48:33 CST