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: Windows - executing sqlplus commands without a temporary file

RE: Windows - executing sqlplus commands without a temporary file

From: Reardon, Bruce (CALBBAY) <Bruce.Reardon_at_comalco.riotinto.com.au>
Date: Wed, 3 Mar 2004 15:17:26 +1100
Message-ID: <DF33C5D0C428FE4DBC8410FC2793EE7F01E76E7A@calbbsv025.cal.riotinto.org>


Tanel,
Thanks for this suggestion, but I can't get it to work.

I understand con (or con:) is a special device and can do things such as copy con: fred.txt and finish with a <ctrl-z>

When I copy what you've got into a batch file and run it, it sits at the sqlplus prompt until I hit <ctrl-z> and then the window goes (if I leave the exit in) or it says "'select' is not recognized as an internal or external command, operable program or batch file." if I take the exit out and put a pause in.

What am I missing?

Thanks,
Bruce Reardon

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Tanel Põder Sent: Tuesday, 2 March 2004 6:08 PM

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

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

Tanel.

> 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_at_sid | sqlplus /nolog
> However, this isn't really very useful.
>
> More useful is something like:
> rem --start of batch file
> ( echo connect user/pwd_at_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_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Mar 02 2004 - 22:18:47 CST

Original text of this message

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