If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Database Server Software > Oracle > P2-0310: unable to open file in SQL Plus

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Mar 2004
Posts: 205
P2-0310: unable to open file in SQL Plus


I have queries in file "query.sql" file. In SQL Plus i've executed it as

@ query.sql

P2-0310: unable to open file "q.sql"

error message is displayed.

If I execute it giving full path like:

@ c:\query.sql

No error message is displayed. Hence I need to place the "query.sql" in a folder so that I can execute it directly.

Please guide me.
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Apr 2004
Posts: 246
If I understand correctly, then you're options are

1) change the start in folder of sqlplus to the location of the script
or (I prefer this next one)
2) set the value of SQLPATH in regedit to the script folder. SQLPATH can actually contain multiple folders, so you can spread your code into multiple locations (in some logical order). SQLPATH might already be defined under ORACLE, ALL_HOMES or HOME# - if it is, modify it there. If not, define it in one of those keys and see if it works (the key location can change on some versions of sqlplus/windows, and defining it at the wrong place can make sqlplus fail to start). To make SQLPATH contain multiple folders, delimit the folder names with a semicolon (and don't put any extra spaces at the beginning or end of the folder names).
Reply With Quote
  #3 (permalink)  
Registered User
Join Date: May 2004
Location: BA [ARG]
Posts: 137
You can always put "host" and press enter within sqlplus and a prompt window will appear with the exact location (path) where you're standing.

If you start sqlplus from a prompt window in c:\ you'll be able to run that script as @query

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On