Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL Query
Hi,
I am having a few problems trying to execute dynamic SQL queries.
The function that I have written builds up a dynamic SELECT statement. The function then executes the sql statement, loops through the returned data and in this case outputs the value to the screen.
This example mocks up the dynamic creation of the sql statement for simplicity:
I get the following error message:
In an attempt to prove the the fault is with the "EXECUTE IMMEDIATE" clause I have tried running the query as if the SELECT was static:
This, rather unsurprisingly, works fine. Does anybody have any idea how I can get this query working using a SELECT statement that is built up dynamically?
Many Thanks,
Jamie Jones.
Received on Tue Aug 19 2003 - 10:34:45 CDT
![]() |
![]() |