Re: Using dynamic SQL in Developer 2000

From: username <username_at_fyiowa.infi.net>
Date: 1997/06/10
Message-ID: <339D766A.40AF_at_fyiowa.infi.net>#1/1


Maoz Mussel wrote:
>
> Hi,
>
> I would like to run dynamic SQL statement in Developer 2000.
> In particular, I would like to run the following query:
> SELECT count (*) FROM table_name WHERE|| where_var
>
> Where 'where_var' will be a variable including the where statement.
> I know I should be doing it using DBMS_SQL (is there another way ???),
> but:
> 1) Current version of D2k doesn't support pl/sql 2 which I need to
> run such a query.
> 2) I try to run it directly from the server, and couldn't found the
> correct syntax.
>
> If you have an example to what I need, and/or can advice me some
> more on this subject, please reply.
>
> Thanks in advance,
> Maoz
> (mmussel_at_iil.intel.com)

Check out the FORMS_DDL(sql_stmt) built-in, but this won't allow you to return your count.
Or, put your code in a database procedure with DBMS_SQL, pass it the sql_stmt and use an out parameter for your count.

rgds, Received on Tue Jun 10 1997 - 00:00:00 CEST

Original text of this message