Re: Dynamic Query

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 02 Sep 1998 18:08:45 GMT
Message-ID: <35fa8938.18858797_at_192.86.155.100>


A copy of this was sent to Cedric ROCHE <cedric.roche_at_snv.jussieu.fr> (if that email address didn't require changing) On Wed, 02 Sep 1998 14:16:05 +0200, you wrote:

>Hello,
>
>We used Developer 2000 Builder 2.0 and in a form
>we wanted to build a special PL/SQL procedure.
>
>This procedure receive in parameters a name of a table (toto)
>and we wanted to make a query like :
>
>select count(*) from toto ;
>
>Is it possible ?
>
>The procedure could be like this :
>********************************
>procedure Trait( toto char, resu integer) is
>begin
>select count(*) into resu from toto ;
>end ;
>********************************
>
>Thank you for your help .
>
>Cedric

two ideas come to mind

1- within D2K use the functions create_group_from_query and populate_group_from_query to dynamically execute a select statment and have the results go into a record group (which you can then access in a fashion similar to a 2 dim. array)

2- use dbms_sql to dynamically do the same thing. dbms_sql is a server side package.

#1 is probably the fastest/easiest way to do it in D2K...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/    -- downloadable utilities
 
----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation
 
Anti-Anti Spam Msg: if you want an answer emailed to you, 
you have to make it easy to get email to you.  Any bounced
email will be treated the same way i treat SPAM-- I delete it.
Received on Wed Sep 02 1998 - 20:08:45 CEST

Original text of this message