Home » RDBMS Server » Performance Tuning » query issue with execute immediate (11.2.0.4)
query issue with execute immediate [message #663374] Thu, 01 June 2017 04:36 Go to previous message
grpatwari
Messages: 288
Registered: June 2008
Location: Hyderabad
Senior Member
Hi,

I have a insert query in the procedure with execute immediate and it is taking time. Due to this my procedure is taking time. Please help me on this. My sample code as below.

procedure test(p_qp_req_id        VARCHAR2,
    p_parent_qp_req_id VARCHAR2,
    p_avail_check      VARCHAR2,
    p_threshold        NUMBER,
    p_poolid           VARCHAR2,
    p_continueavail    VARCHAR2,
    p_rescount OUT NUMBER,
    p_ret_code OUT VARCHAR2,
    p_ret_msg OUT VARCHAR2)

begin

v_poolsql:= 'insert into pc_eri_erimatch_matchres_gtt(qp_req_id,corpid,personid,pool_id,positionid,workschedulerule) '||
            ' select distinct   '|| P_QP_REQ_ID||'  P_QP_REQ_ID ,res.corpid, res.personid,rmap.pool_id,res.positionid ,res.workschedulerule '||
            ' from pc_eri_erimatch_res_info res ,pr_eri_data_pool_res_mapping rmap '||
               q'[  where res.resourcestatus='Active' and res.personid=rmap.personid(+)  ]';
if p_poolid is not null
then


v_poolsql:=v_poolsql || ' and rmap.pool_id in  ('''||p_poolid||''' )' ;

end if;

EXECUTE IMMEDIATE v_poolsql;


end test;

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PLS-00201: identifier 'DBMS_AWR.ENABLE_AWR' must be declared
Next Topic: Gathering Statistics of Partitioned table
Goto Forum:
  


Current Time: Fri Apr 26 08:27:03 CDT 2024