Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Running SQLPlus from command line

Re: Running SQLPlus from command line

From: Thomas Kellerer <ESPKLFCTEKVY_at_spammotel.com>
Date: Wed, 11 Oct 2006 17:14:11 +0200
Message-ID: <4p4g24Fha0rtU1@individual.net>


On 11.10.2006 16:58 RLN wrote:
  > My 5 line batch file runs, (listed below) but there are four problems I
> can't seem to resolve.
> 1. echo statement (line 5) when completed: "Echo done running
> TEST12.BAT"
What exactly is the question here?

> 2. After Line 4 executes SQLPlus the batch file hangs. I do not see
> data, don't know if the query is finished, etc.

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1009789

> 3. Is there a statement that I can use that will return whether SQLPlus
> successfully connected to the database? I think it connects, but am
> unsure actually.

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch6.htm#1006648

> 4. I need to save the data output. When the query is completed, how do
> I tell SQLPlus (via another line in the batch file) to save the
> contents to either a .csv file or .xls file, and exit, thus passing
> control back to the final line of the batch file to display the
> 'process completed' message?
> I need to save this output file (be it .csv, .txt, or .xls) to the
> local drive so an Access program can pick it up and do more processing
> with it.

.xls is not possible. For the rest see the spool command http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013669

> When using the SQLPlus Command Line in a batch file in silent mode, is
> there a limitation of filetypes the data retreival to be exported to?
> I think choosing between .txt, .csv, and .xls woud be fine.
SQL*Plus does not "export" data. It prints out results which you can redirect to files. Again see the SPOOL command and

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch7.htm#1005594

Thomas Received on Wed Oct 11 2006 - 10:14:11 CDT

Original text of this message

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