Home » SQL & PL/SQL » SQL & PL/SQL » Batch File to run SQL Program
Batch File to run SQL Program [message #20213] Tue, 07 May 2002 04:03 Go to next message
sql gurus
Messages: 22
Registered: May 2002
Junior Member
Hi,

Can any one tell me how to write a batch file which runs an sql program without asking for username and password.

I tried like this.

SQLPLUS.EXE USER/PWD@DATABASE <file.sql>

It is not working.
Re: Batch File to run SQL Program [message #20217 is a reply to message #20213] Tue, 07 May 2002 06:48 Go to previous messageGo to next message
Grant
Messages: 578
Registered: January 2002
Senior Member
What is the exact error you get when you run this command?
Re: Batch File to run SQL Program [message #20221 is a reply to message #20213] Tue, 07 May 2002 09:05 Go to previous messageGo to next message
sql gurus
Messages: 22
Registered: May 2002
Junior Member
The program is not getting started at all
Re: Batch File to run SQL Program [message #20223 is a reply to message #20213] Tue, 07 May 2002 22:18 Go to previous messageGo to next message
S.Muthu Kumar
Messages: 6
Registered: July 2001
Junior Member
Hi,

create a sql file with the following contents
select * from emp;

save it as c:test.sql

Create a batch file with the following contents

sqlplus scott/tiger@db c:test

execute the batch file.

This shld solve ur reqmt.

HTH
S.Muthu Kumar
Re: Batch File to run SQL Program - correct [message #20224 is a reply to message #20213] Tue, 07 May 2002 22:19 Go to previous messageGo to next message
S.Muthu Kumar
Messages: 6
Registered: July 2001
Junior Member
Hi,

create a sql file with the following contents
select * from emp;

save it as c:test.sql

Create a batch file with the following contents

sqlplus scott/tiger@db @c:test

execute the batch file.

This shld solve ur reqmt.

HTH
S.Muthu Kumar
Thanks [message #20260 is a reply to message #20224] Thu, 09 May 2002 07:22 Go to previous message
sql gurus
Messages: 22
Registered: May 2002
Junior Member
Thanks Kumar. It worked. I just missed @ symbol
Previous Topic: Foreign Key Reference
Next Topic: Storing Images in Oracle
Goto Forum:
  


Current Time: Tue Apr 23 05:46:14 CDT 2024