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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL

Re: PL/SQL

From: Surfnet <j.r.l.m.batailleREMOVE##_##THIS_at_uva.nl>
Date: Wed, 20 Mar 2002 19:24:50 +0100
Message-ID: <a7akbm$707$1@news.surfnet.nl>


Hello Laurent,
you can do this like this with the DBMS_SQL package where you can construct your SQL statement with variables.
It's a little harder to write. This is nowadays called 'native dynamic SQL'. Have a look at the doc's.

Regards, Joost

--
Joost Bataille
University of Amsterdam ICT centre
www.ic.uva.nl

"Laurent Boutet" <laurent.boutet1_at_libertysurf.fr> wrote in message
news:a7acet$gv8$1_at_reader1.imaginet.fr...

> Hi,
>
> Here is my question :
>
> In my stored proc, I copy 2 times likely the same code. I mean, the code
is
> just a bit different for instance :
>
> if param=1 then
> select * from table1;
> else
> select * from table2;
>
> This is a very basic code...but imagine I have hundred lines !!!
> If only I could do such a code :
> select * from table<param>
>
> So I would just have to set the param value...for instance, param=2 then,
I
> would have select * from table2;
>
> How can I do such a thing ??????
Received on Wed Mar 20 2002 - 12:24:50 CST

Original text of this message

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