Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dynamic SQL
CREATE OR REPLACE PROCEDURE EXEC_DYN_SELECT ( Field3_Value INTEGER ) IS
CURSOR C1 IS
SELECT Field1, Field2 FROM Table1 WHERE Field3 = Field3_Value;
DBMS_OUTPUT.PUT_LINE ( 'Field1 = ' || R1.Field1 || ' And Field2 = ' || R1.Field2 );
END LOOP;
END ;
This is one of the solutions ... this is for the case of a where clause
dynamic ...
Of course there's many other ways to make more dynamic queries within a PL SQL proc. All depends on what dynamism you want ...
If you want, let us knowing more about what you want to do .
Cheers,
Stef
"Jet" <jet_ming_chan_at_hotmail.com> a écrit dans le message de news:
c789f9ad.0211020057.443a2190_at_posting.google.com...
> How to Create A Procudure/Function which Execute Dynamic SQL Select
> Statement And Return A Cursor
Received on Mon Nov 04 2002 - 04:06:18 CST