Home » SQL & PL/SQL » SQL & PL/SQL » Run SQL files using SQL-PLUS
Run SQL files using SQL-PLUS [message #228359] Mon, 02 April 2007 12:44 Go to next message
rudorathod
Messages: 14
Registered: October 2006
Junior Member
I have a file located on 'C:\Documents and settings\home\jobs\run.sql' and I want to execute this sql file
using SQL-PLUS, I'm getting this following error message,

SP2-0310: unable to open file "run.sql"
SP2-0310: unable to open file "C:\Documents.sql"

Where do I store my .sql files in order to run the following command?
@run.sql

Thanks
Re: Run SQL files using SQL-PLUS [message #228371 is a reply to message #228359] Mon, 02 April 2007 14:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Use: @"C:\Documents and settings\home\jobs\run.sq" with quotes.

Regards
Michel
Re: Run SQL files using SQL-PLUS [message #228376 is a reply to message #228359] Mon, 02 April 2007 15:05 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
As Michel said, when you have directories with spaces in them you have to tell sql plus to include the spaces in the path instead of using the default of using space as a delimiter. You might want to get in the habit of storing scripts in a path without spaces. A large number of third party application have a lot of problems with them.
Re: Run SQL files using SQL-PLUS [message #228405 is a reply to message #228376] Mon, 02 April 2007 23:26 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
it is better to include space in directory path. So it may be same a direct like c:\test_dir\test.sql and run the query using the command
@c:\test_dir\test.sql
Re: Run SQL files using SQL-PLUS [message #228406 is a reply to message #228405] Mon, 02 April 2007 23:28 Go to previous message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
sorry is it not better using space in directory
Previous Topic: max date
Next Topic: how to call an sql script with in the PL/SQL script
Goto Forum:
  


Current Time: Fri Dec 09 23:03:29 CST 2016

Total time taken to generate the page: 0.24153 seconds