Anonymous block performing much worse then separated statements

  • From: Douglas Cowles <dcowles@xxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 27 Jul 2011 12:44:10 -0400

Basically.. oracle 10.2.0.4 on solaris. 

I two statements that when are executed separately, a truncate and an 
insert - they run in seconds. 
When put in an anonymous block, they take more than 20 minutes and begin 
to throw errors. 
Does anyone have any explanation for this? 

the block looks something like this - 
BEGIN

 

    TRUNCATE_TABLE('WANDH_HR'); 

 

    INSERT INTO WANDH_HR(EMPLID,STATE,CREATE_TS,MAINT_TS)

        (SELECT

            A.EMPLID

            ,'NJ' As "STATE"

            ,'12-Jul-2011' As "CREATE_TS"

            ,'12-Jul-2011' As "MAINT_TS"

        FROM

            (

                .
        .
        .etc., 
        .
        .

 

END;



Doug Cowles

Other related posts: