Home » SQL & PL/SQL » SQL & PL/SQL » How to execute a query as parameter/variable in PLSQL block
How to execute a query as parameter/variable in PLSQL block [message #241068] Mon, 28 May 2007 04:56 Go to next message
navinphavade
Messages: 7
Registered: March 2007
Location: Pune
Junior Member
Hi

I want to execute a query which is in form of variable(or parameter) in a plsql function.
Re: How to execute a query as parameter/variable in PLSQL block [message #241074 is a reply to message #241068] Mon, 28 May 2007 05:00 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
And what would you want to do with the result?
Search the docs for ref cursors.
Re: How to execute a query as parameter/variable in PLSQL block [message #241226 is a reply to message #241068] Mon, 28 May 2007 23:17 Go to previous messageGo to next message
navinphavade
Messages: 7
Registered: March 2007
Location: Pune
Junior Member
Got the answer
its EXECUTE IMMEDIATE
Re: How to execute a query as parameter/variable in PLSQL block [message #241257 is a reply to message #241226] Tue, 29 May 2007 00:36 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Question remains: what to do with the results.
If you use execute immediate, you have to know upfront (more or less) what variables you will use.
If you know that upfront, you might not need dynamic sql...
Previous Topic: Regarding bulk insert (merged topics)
Next Topic: Getting Unique Records from the table
Goto Forum:
  


Current Time: Sat Dec 14 13:07:27 CST 2024