Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2004, 12:24 PM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQLPlus question

Hello,

I am having some trouble with the SQLPlus tool over the command line.

Here is what I do:

on the command line I give the command:
sqlplus /nolog @c:\mycommands.sql

The mycommands.sql file contains:

CONNECT sys/syspass@mydatabase as sysdba
spool c:\output.txt
Select * from some_table
spool off
exit

However, the command line only shows the message connected and does not exit. The spool file also contains no information. I want it to execute the command and quit SQLPlus.

I hope someone can help me.

Thanks,
Pankaj

 
Old June 27th, 2004, 03:10 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Works fine for me:

------------------------------------------------
C:\>type mycommands.sql
CONNECT scott/tiger@playdb.world
spool c:\output.txt
Select sysdate from dual;
spool off
exit

C:\>type output.txt
The system cannot find the file specified.

C:\>sqlplus /nolog @c:\mycommands.sql

SQL*Plus: Release 9.0.1.0.1 - Production on Sun Jun 27 15:07:09 2004

(c) Copyright 2001 Oracle Corporation. All rights reserved.

Connected.

SYSDATE
---------
27-JUN-04

Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production

C:\>
C:\>type output.txt

SYSDATE
---------
27-JUN-04


C:\>

--------------------------------------------------------

I am on W2K Pro.

AM





Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing a Field in SQLPLUS tafettaflsh Oracle 1 April 9th, 2009 05:10 PM
1 More question!! (me think!) Mantis MySQL 2 March 8th, 2005 08:26 AM
Calling SQLPLUS Procedure from javascript function rnesti Javascript 3 January 28th, 2005 05:55 PM
actually it's a C question buzzfever C++ Programming 2 October 13th, 2003 09:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.