Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: help for execute immediate
Can u try to have another variable, append the 'whereclause' to that
variable, and then Execute the query?
<example>
l_query := 'SELECT count(*)'
||' FROM usr,'
|| ' act,' || ' oiu,' || ' obi,' || ' obj,' || ' ugp,' || ' usg,' || ' aad,' || ' oug'
||' WHERE usr.act_key = act.act_key'
||' AND usr.usr_key = oiu.usr_key'
||' AND oiu.obi_key = obi.obi_key'
||' AND obi.obj_key = obj.obj_key'
||' AND usg.usr_key = usr.usr_key'
||' AND usg.ugp_key = ugp.ugp_key'
||' AND aad.act_key = act.act_key'
||' AND aad.ugp_key = ugp.ugp_key'
||' AND obj.obj_key = oug.obj_key'
||' AND oug.ugp_key = ugp.ugp_key'
|| whereclause INTO inttotalrows_out' ;
EXECUTE IMMEDIATE l_query .....
</example>
Ashish Received on Wed Jan 18 2006 - 01:53:22 CST
![]() |
![]() |