Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus run script in neighbouring directory

Re: sqlplus run script in neighbouring directory

From: <sybrandb_at_hccnet.nl>
Date: Tue, 11 Dec 2007 20:14:02 +0100
Message-ID: <e9otl3l277nb8dj0tov6pct065cb59fu0s@4ax.com>


On Tue, 11 Dec 2007 08:22:55 -0800 (PST), Stan.Sulc_at_gmail.com wrote:

>On 11 Pro, 17:07, gazzag <gar..._at_jamms.org> wrote:
>> On 11 Dec, 15:03, Stan.S..._at_gmail.com wrote:
>>
>> > Hi,
>> > I need to run one script from another which is in another directory
>> > and i can't work it out. Here is how it is:
>> > +parent_dir
>> > +child_dir_1
>> > +script_1.sql
>> > +child_dir_2
>> > +script_2.sql
>>
>> > I want to run script_2.sql from script_1.sql and expected to use
>> > something like following:
>> > @@..\child_dir_2.sq\script_2.sql but it doesn't work and i keep
>> > getting SP2-0310: unable to open file error no matter what i try. Any
>> > help will be appreciated.
>>
>> SQL*Plus from a command prompt (sqlplus.exe) or SQL*Plus for Windows
>> (sqlplusw.exe)?
>>
>> The former will run scripts relative to the directory you were in when
>> you logged into SQL*Plus. The latter defaults to your ${ORACLE_HOME}/
>> bin directory.
>>
>> What happens if you fully qualify the pathnames?
>>
>> HTH
>>
>> -g
>
>I use the command prompt one. I don't want to depend on the directory
>I start sqlplus from nor on any other directory, so I wanted to use @@
>instead of @, but it apparently doesn't work :-(

@@ works fine.
If you would have looked up @@ in the sqlplus reference manual, you would have noticed @@ runs scripts in the *same* directory as the calling script.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Tue Dec 11 2007 - 13:14:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US