executer script from toad [message #323535] |
Wed, 28 May 2008 12:41 |
shoaib123
Messages: 118 Registered: December 2007 Location: Chicago
|
Senior Member |
|
|
Hi,
I am really new in Toad. Please help somebody on my this dummy question.
i have a script sitting in some directiry like
C:\scrtip\a.txt.
i need to execute this sql script file from toad using something like this..
exec C:\script\a.txt
but it is giving me an error. can u make correction of this commnd line syntax.
I appreciate for any help on this.
thanks for you valuable time.
|
|
|
Re: executer script from toad [message #323538 is a reply to message #323535] |
Wed, 28 May 2008 12:53 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
The menu locations depend on your version. In my 9.6, I do this to run my script in SQLplus. (Toad has it's own script runner that I've never used).
In options, under executables, select path to sqlplus.
From a sql window, enter "@C:\script\a.txt"
Editor > Execute SQL via SQL*plus.
|
|
|
Re: executer script from toad [message #323541 is a reply to message #323535] |
Wed, 28 May 2008 13:23 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
shoaib123 wrote on Wed, 28 May 2008 13:41 |
I am really new in Toad. Please help somebody on my this dummy question.
i have a script sitting in some directiry like
C:\scrtip\a.txt.
i need to execute this sql script file from toad using something like this..
exec C:\script\a.txt
but it is giving me an error. can u make correction of this commnd line syntax.
|
I don't see any error, so I am going to make an assumption. The name of the directory in the EXEC command is different than the actual directory name (scrtip vs. script). File or Directory not found.
|
|
|
|
Re: executer script from toad [message #323543 is a reply to message #323541] |
Wed, 28 May 2008 13:37 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
exec is a sqlplus command that gets converter to begin end;
So:
essentially gets converted to:
begin
C:\script\a.txt
end;
which is invalid pl/sql.
To run a sql file from sqlplus, "start", "@" and "@@" are the most commonly used. "@@" isn't really appropriate here.
start C:\script\a.txt
@C:\script\a.txt
@@C:\script\a.txt
|
|
|