Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - how to create a log output, while running a SQL Script?

Status
Not open for further replies.

sdas123

IS-IT--Management
Jun 19, 2003
2
US
How could I create a log output file while I run a SQL Script manually?
 
Unlike Oracle SQL*Plus you cannot use spool command. However, you can create an sql file such as the following:

Code:
sybase@linux:/tmp% cat getdate.sql
use master
go
select getdate()
go
exit

and run it as

Code:
sybase@linux:/tmp%  isql -Usa -w1000 -i getdate.sql -o getdate.log
Password:
sybase@linux:/tmp% more getdate.log

 --------------------------
        Jun 23 2003  9:46PM

(1 row affected)

-i refers to the input file and -o refers to the output filename
Hope this helps
 

If you want to see all the actual SQL executed, with the results afterwards, use the '-e' option from isql. It will echo all the sql commands, and then execute the sql.

good luck...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top