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: H/T put value of lexical reference into bind variable?

Re: H/T put value of lexical reference into bind variable?

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Tue, 28 Dec 1999 23:52:55 +0100
Message-ID: <946421650.25533.0.pluto.d4ee154e@news.demon.nl>


simply leave out the quotes
hold := &F_1;
or
hold := to_number('&F_1');

defines are indeed substituted, if you put them in quotes they will be treated as a string, if you don't quote them as a number.

It definitely should work this way

Hth,

--
Sybrand Bakker, Oracle DBA
work <terry.barhorst_at_rrc.state.tx.us> wrote in message news:1103_946420921_at_barhorst-nt...
> Hi:
>
> I want to put the value of a lexical reference (substitution variable)
into a bind variable so I can pass/use it to/in a function.
>
> I'm using Report Builder 3.0.5.13.0, PL/SQL Release 2.3.4.5.0 Production.
>
> I've seen an example like this:
>
> ..
>
> hold number := '&F_1';
>
> begin
>
> if hold = 1 then
> srw.message(100, 'works: ' ||
hold);
> return (hold);
> else
> srw.message(200, );
> return (0);
> end if;
>
> end;
>
> But this gives me a numeric error ('&F_1' value should be a number), the
value of 'hold' is '&F_1' apparently instead of the value of '&F_1'.
>
> ..
>
> hold varchar2(10) := '&F_1';
>
> begin
>
> if hold = '1' then
> srw.message(100, 'works: ' ||
hold);
> return (hold);
> else
> srw.message(200, 'bad karma: '
|| hold);
> return (0);
> end if;
>
> end;
>
> Once again the value of 'hold' is '&F_1' and not the value of '&F_1'.
>
> I know lexical references can't be used in pl/sql blocks, but there has to
be a way to get the value for use inside a block.
>
> Any information would help. Thanks.
>
> Terry Barhorst
> terry.barhorst_at_rrc.state.tx.us
>
>
Received on Tue Dec 28 1999 - 16:52:55 CST

Original text of this message

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