Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: help for execute immediate

Re: help for execute immediate

From: Ashish <srivastava.ashish_at_gmail.com>
Date: 17 Jan 2006 23:53:22 -0800
Message-ID: <1137570802.796659.133120@g49g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US