Re: how to pass file path as parameter between sql files within sqlplus

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 25 May 2002 11:41:09 +0200
Message-ID: <uev1k4tc946j08_at_corp.supernews.com>


"Chenggang" <duancg_at_hotmail.com> wrote in message news:8e262639.0205241438.63594c_at_posting.google.com...
> Hi,
>
> I have a problem with passing filenames with path between .sql files.
> The problem is the separator '/'. The example below shows the
> problem:
>
> 1. Create two sql files in ~/tmp directory:
>
> --------------------------------
> -- <<a.sql>> :
> -- begin of a.sql --
> _at__at_b.sql 'as/df'
>
> -- end of a.sql --
>
>
> --------------------------------
> -- <<b.sql>> :
> -- begin of b.sql --
> set define on
>
> select '&1' from dual;
>
> -- end of b.sql --
>
> 2. Then go to ~/ (home directory) and login to SQL*Plus, then call
> a.sql like this:
> SQL> _at_tmp/a.sql
> SP2-0310: unable to open file "b.sql"
> SQL>
>
> 3. But if I modify a.sql to pass a value without '/' (E.g., use
> _at__at_b.sql 'asdf'), it runs OK:
> SQL> _at_tmp/x.sql
> old 1: select '&1' from dual
> new 1: select 'asdf' from dual
>
> 'ASD
> ----
> asdf
>
> SQL>
>
> 4. Also, if I login to SQL*Plus from ~/tmp directory, the problem goes
> away.
>
> I will really appreciate it if anyone could share some ideas on it
> because I couldn't find any document explaining why the '/' character
> is a problem. Thanks a lot!
>
> Chenggang

Unix metacharacters need to be escaped by a \

--

Hth


Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Sat May 25 2002 - 11:41:09 CEST

Original text of this message