Run the query as Script in SQLPLUS
Hello,
I have written SQL query as script on windows machine. How do i access this file from sqlplus. To put the question other way How can i run the query as Script in SQLPLUS?
One way to do is to copy the script direclt and Paste it.
But I want to know how do we run it as script?
Re: Run the query as Script in SQLPLUS
You need to save the file as .SQL extension. Better to store in BIN folder in oracle home path.
To call the file use
start filename
or
@filename
Re: Run the query as Script in SQLPLUS
[QUOTE=prakash.kudrekar;18751]Hello,
One way to do is to copy the script direclt and Paste it.
[/QUOTE]
One thing you can do in regard to this is that, Like Debasis has mentioned save the file with SQL extension and at the SQLPLUS prompt give @filename.
Else you can use [B]get[/B] filename to write the contents of that file into the SQL buffer and then simply use / to run it.
Hope this helps...
Re: Run the query as Script in SQLPLUS
First save the file with .sql extension and in sqlplus call the file using
@ requiredpath
ex: @ c:\ex i think it will help u
Re: Run the query as Script in SQLPLUS
Run the query as Script in SQLPLUS
follow the following steps for the solutions:-
1) create the file either in word-pad,Ms-word or in notepad.but prefer notepad usually.
2) save the file with the name having extension ".sql".for eg.. save the file as abc.sql. here abc is the file name and .sql is extension.
3) open oracle.give the appropriate path of the file following by "get" keyword.
suppose file is saved in c:/.the the statement will be
with double quotes i.e " get @ c:/abc.sql"; press enter.
4) sometime forward '\' is applicable while sometime backward'/' is used.if there is error in '/' then try with '\' or vice-versa.
but always keep in mind that the script must be save with extension " .sql" as we were using the script in oracle/sql.
hope ur problem will be solved.