Re: Windows - executing sqlplus commands without a temporary file

  • From: Tanel Põder <tanel.poder.003@xxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 2 Mar 2004 09:08:02 +0200

sqlplus "/ as sysdba" < con
select 1 from dual;
select 2 from dual;
exit

CON is a special device "console" in DOS&Windows.

Tanel.

----- Original Message ----- 
From: "Reardon, Bruce (CALBBAY)" <Bruce.Reardon@xxxxxxxxxxxxxxxxxxxxxxx>
To: <oracle-l@xxxxxxxxxxxxx>
Sent: Tuesday, March 02, 2004 6:58 AM
Subject: Windows - executing sqlplus commands without a temporary file


> This subject has come up a number of times in the past.
>
> For single line commands, you can use something like:
> echo connect user/pwd@sid | sqlplus /nolog
> However, this isn't really very useful.
>
> More useful is something like:
> rem --start of batch file
> ( echo connect user/pwd@sid
> echo select user from dual;
> echo select sysdate from dual;
> ) | sqlplus /nolog
> rem --end batch file
>
> This works under XP & W2K and avoids the need to have a temporary file.
>
> Given this, can anyone see how to avoid having to put the echo on every
line?
>
> Thanks,
> Bruce Reardon
>
> NOTICE: This e-mail and any attachments are private and confidential and
may contain legally privileged information.  If you are not an authorised
recipient, the copying or distribution of this e-mail and any attachments is
prohibited and you must not read, print or act in reliance on this e-mail or
attachments.  This notice should not be removed.
>
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
> put 'unsubscribe' in the subject line.
> --
> Archives are at //www.freelists.org/archives/oracle-l/
> FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: