Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sqlplus run script in neighbouring directory

1,028 views
Skip to first unread message

Stan...@gmail.com

unread,
Dec 11, 2007, 10:03:21 AM12/11/07
to
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.

gazzag

unread,
Dec 11, 2007, 11:07:37 AM12/11/07
to

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

Stan...@gmail.com

unread,
Dec 11, 2007, 11:22:55 AM12/11/07
to

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 :-(

sybr...@hccnet.nl

unread,
Dec 11, 2007, 2:14:02 PM12/11/07
to

@@ 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

Stan...@gmail.com

unread,
Dec 12, 2007, 8:58:29 AM12/12/07
to
On 11 Pro, 20:14, sybra...@hccnet.nl wrote:

Well, I am aware of the fact that @@ runs script in the "same"
directory, but i wanted to run a script relatively to the "same"
directory using "..\" to get to parent directory or to
"\subdirectory". And this is what IMHO doesn't work with @@. Although
it is fine with @.

0 new messages