Re: capturing host variables

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 9 Oct 2001 00:24:59 -0700
Message-ID: <a20d28ee.0110082324.4bf772f2_at_posting.google.com>


traceable1_at_hotmail.com (traceable1) wrote in message news:<8551d8c9.0110080520.6926925a_at_posting.google.com>...
> I need to get the current OS directory from within SQL*Plus. I have a
> SQL*Plus script which calls several other SQL*Plus scripts. This
> script needs to be able to run from anywhere, but all of the scripts
> will be in the same directory (I just don't which one). So the user
> will run the main SQL*Plus script and I want wo preface the calls with
> the directory by way of a variable.
>
> Main script: call_ora.sql
> _at_{directory path}ora1.sql
> _at_{directory path}ora2.sql
>
> In windows, I know "CHDIR" will give me the current directory, but I
> don't know how to get it or use it in Oracle.
>
> Any help is very much appreciated!
> Thanks,
> Tracy

A better solution would be setting the SQLPATH environment variable (or registry value), which acts as PATH for sql scripts. If you want to call sqls in the same directory the root script is running you can use the _at_@<filename> syntax, this prevents you from having to specify the directory.

Hth,

Sybrand Bakker
Senior Oracle DBA Received on Tue Oct 09 2001 - 09:24:59 CEST

Original text of this message