Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Method 4 of Dynamic SQL
Pepe Galindo wrote:
>
> Hello!
>
> Method 4 of Dynamic SQL accepts and proceses queries when we don't know
> the number of select-list columns until run time.
>
> I have some questions about it:
>
> 1.- Is it possible to use Method 4 of Dynamic SQL inside a PL/SQL
> subprogram? or is it only possible in embedded SQL?
> 2.- How can I do that?
> 3.- How can I declare a data structure of SQLDA type (SQL Descriptor Area)
> in PL/SQL?
>
> In negative case:
>
> 4. Can I write de select command in a file and execute this file from the
> PL/SQL program (like from SQL*PLUS: @file), obtaining the results as in
> SQL*PLUS ?
>
> I will be very grateful if you can help me. Thanks.
> ppgg_at_lcc.uma.es
> http://www.lcc.uma.es/personal/ppgg/galindo.html
Without looking at a manual I don't know what Method 4 is, but may be able to answer your question anyway. Yes you can use PL/SQL to perform dynamic SQL without knowing the select list, where clause, etc. until runtime. You do this by using the package DBMS_SQL. You can construct the statement at runtime and use DBMS_SQL to execute it or declare a cursor based on it, etc.
Chris Halioris Received on Fri Aug 01 1997 - 00:00:00 CDT
![]() |
![]() |