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: Parameter substitution question

Re: Parameter substitution question

From: <prochak_at_my-dejanews.com>
Date: Thu, 13 Aug 1998 01:16:34 GMT
Message-ID: <6qteph$9iq$1@nnrp1.dejanews.com>


In article <35CEC813.3EAB5652_at_exlibris.co.il>,   Ariel Kirson <arielk_at_exlibris.co.il> wrote:
> Hi all,
>
> I recently posetd a similar question, without
> any sample code. I hope this time it will be more
> clear. I have written the following script (monrep1.sql) :
>
> declare
> this_month char(3) := to_char(SYSDATE,'Mon');
> last_month char(3) := to_char(add_months(SYSDATE,-1),'Mon');
> this_year char(4) := to_char(SYSDATE,'YYYY');
> begin
> @monrep &this_month &last_month &this_year;
> end;
>
> When I run this script (@monrep1) I am prompted for the values
> of this_month, last_month and this_year. How can I send the
> values of the variables to "monrep.sql" ?
>
> Thanks in advance,
>
> Ariel Kirson
> Ex Libris.
>
>

Since they are already PL/SQL variables, you just use them as you would in any PL/SQL prcedure. By putting the ampersand (&) prefix on them, you are making them SQL PLUS substitution variables. That's why you get prompted.

Change your line to:

 @monrep this_month last_month this_year ;

and it should work fine.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Wed Aug 12 1998 - 20:16:34 CDT

Original text of this message

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