Re: Dynamic queries in PL/SQL

From: Erik Forslund <erfo_at_lkp.ifsab.se>
Date: 1996/02/02
Message-ID: <4esip2$409_at_simba.lejonet.se>#1/1


Charles Vaillancourt <charles_at_gmc.ulaval.ca> wrote:

>Little question from a novice: is it possible to compose a query
>dynamically in PL/SQL? i.e. reading a query from a record and executing
>it or building a query in a text-variable and executing it. I can do
>it remotely with a tool like Delphi but I would like to do server
>processing on the results (i.e. in a stored proc)...
>Alternatively can I build a query on a remote tool, get a cursor from it
>and pass the cursor as a parameter to the stored proc?
 

>Thanks for any help or hint...
 

>Louis Perreault
>louisp_at_gmc.ulaval.ca

You must use package DBMS_SQL available in 7.1 and later. This package is able to use the OCI-interface in Oracle. By this interface you have to do all things by yourself like creating a SQL-string, parse it, execute, bind values and fetch data. Please read several articles some days ago and you will find several examples too.

Erik
IFS R&D
erfo_at_lkp.ifsab.se Received on Fri Feb 02 1996 - 00:00:00 CET

Original text of this message