INSERT works but inside a PROCEDURE doesn't Any Idea?

General
Teradata Employee

INSERT works but inside a PROCEDURE doesn't Any Idea?

I have an INSERT statement which is pretty complex, BUT it inserts data in 10 minutes on average consistentlly.  When I put the INSERT into a PROCEDURE 'wrapper' so I can call it, it never finishes.  The EXPLAIN PLAN is good and most steps are in the seconds.  What am I doing wrong?

EXAMPLE:

REPLACE PROCEDURE database1.PROC_INSERT_MONEY ()

BEGIN

/* Insert Data Using existing MONEY INSERT CODE */

/* 1 of 1 */

INSERT INTO database1.MONEY_TABLE

(

col1,

col2

)

SELECT

col1,

col2

FROM Money_TEMP;

END;

The same insert performs in ten minutes, but procedure version doesn't finish.

1 REPLY
Enthusiast

Re: INSERT works but inside a PROCEDURE doesn't Any Idea?

My initial thought:

If ANSI mode, can it be because of no commit?

Can it be that you are running at the same time when you run the insert independently ?