Discussion Locked

Need sample of script to run SQL

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am looking for a sample of a script using SQL that I can run against an Oracle database that sits on a Unix box.
I know how to write SQL and I can run it to my heart's content online; but I want to be able to create a script that can run after work hours. Can anyone send me some examples? Or at least give me some technical points on how to create a script that runs a SQL query.

5 replies

by jay_patrick

here's some code that accesses an MS SQL database on NT, maybe it'll get you started...

'ssss = name of server
'uuuu = user id to connect to database
'pppp = user id password
'dddd = database name

ConnectionString = "driver={SQL Server};" & "server= ssss uid=uuuu ; pwd=pppp; database=dddd "

Set myRS = WScript.CreateObject("ADODB.recordset")

SQL = "select * from........"
myRS.Open SQL, ConnectionString, 1

myRS.close

by fofa

Usually we right a UNIX script that calls SQLPLUS and SQLPLUS calls a SQL script. We start the UNIX script using CRON at a certain date/time.

This discussion is closed to new replies.