Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004

    Unanswered: 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.

  2. #2
    Join Date
    Apr 2004
    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).

  3. #3
    Join Date
    May 2004
    BA [ARG]
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts