SP2-0310 Error when Calling a SQL Script in Another Script using @@ and the Path to the Parent Script Contains Spaces (Doc ID 745780.1)

Last updated on OCTOBER 27, 2016

Applies to:

SQL*Plus - Version 11.1.0.6 to 11.1.0.6 [Release 11.1]
Information in this document applies to any platform.

Symptoms

Given two sql scripts, main_script.sql and script1.sql.

script1.sql is called within main_script.sql using the @@ notation in order to inherit the path used to call main_script.sql.

If the path provided to main_script.sql contains spaces, main_script.sql executes successfully, but script1.sql will fail to execute throwing:

SP2-0310: unable to open file "..."



An exemplification of the issue:

Considering the following two scripts:

A. main_script.sql:

select dname as dept_main_script from dept;
@@script_1.sql


B. script_1.sql:

select dname as dept_script_1 from dept;


- Both scripts are saved in "/test scripts"
(note that this folder name contains a space)


- Steps to test the issue:

 1. Connect as SCOTT using SQL*PLUS.

 2. Execute @"/test scripts/main_script.sql" in SQL*PLUS.

 3. The parent script is executed successfully but then an error is encountered when the inner script is executed:

DEPT_MAIN_SCRI
--------------
ACCOUNTING
RESEARCH
SALES
OPERATIONS

SP2-0310: unable to open file "/test.sql"

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms