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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL parameter &0

Re: PL/SQL parameter &0

From: Ben Graham <bengraham_at_xsmail.com>
Date: 17 Sep 2004 02:28:01 -0700
Message-ID: <f858471c.0409170128.260d82f8@posting.google.com>


pbewig_at_swbell.net (Phil Bewig) wrote in message news:<455f7154.0409160629.76d2a86_at_posting.google.com>...
> In a PL/SQL script run by the START command, I can refer to the
> parameters that follow START as &1, &2, and so on. However, it
> appears that &0 does not refer to the script name, as in C. Is there
> any way to determine the name of a script within the script while it
> is running?
>
> Many thanks,
>
> Phil

Define the name of the script within it.

E.g. test.sql:

DEFINE SCRIPT_NAME="test.sql"
PROMPT The name of this script is &SCRIPT_NAME

If you create this script dynamically then parameterize the value of SCRIPT_NAME.

E.g. for Windows 2k, test.bat:
@echo off
del %1
echo DEFINE SCRIPT_NAME="%1" >> %1
echo PROMPT The name of this script is ^&SCRIPT_NAME >> %1

Run as c:\>test.bat script_name Received on Fri Sep 17 2004 - 04:28:01 CDT

Original text of this message

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