Re: Dynamic queries in PL/SQL

From: Scott Urman <surman_at_oracle.com>
Date: 1996/02/01
Message-ID: <4er2mp$6na_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <3110C5C7.63A0_at_gmc.ulaval.ca>, Charles Vaillancourt <charles_at_gmc.ulaval.ca> writes:
|> 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)...

You can do this with the DBMS_SQL package, PL/SQL 2.1 and higher.

|> 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?

Cursor variables are available with PL/SQL 2.2 and higher, and support this (but I think the other way). You can open a cursor on the server, and pass it to a client written in the precompilers or OCI, and fetch from it there.

|>
|> Thanks for any help or hint...
|>
|> Louis Perreault
|> louisp_at_gmc.ulaval.ca
Received on Thu Feb 01 1996 - 00:00:00 CET

Original text of this message