Hello there,
I encounter the following problem when executing a procedure using TOAD connecting to Oracle 10g server. The problem is as following.
I have a procedure which is a statement insert a set of values retrieved by running a SELECT .. FROM ... WHERE ... START WITH ... CONNECT BY statement. It's as following:
INSERT INTO TAB_INS
SELECT T.TREE_ID, T.PARENT_ID, T.SDATE, T.SALARY
FROM TAB_TREE T
WHERE T.SDATE = '01-Jan-2004'
START WITH T.TREE_ID = 'rt'
CONNECT BY PRIOR T.TREE_ID = T.PARENT_ID;
I can run this selection query in only a few seconds and return nearly a million records. But when I put the "INSERT INTO TAB_INS' statement to insert the records into the table, it takes damn long time, and actually I suspect it is not going to stop. Is there anything wrong with this statement? Or is there any advice on this?
I encounter the following problem when executing a procedure using TOAD connecting to Oracle 10g server. The problem is as following.
I have a procedure which is a statement insert a set of values retrieved by running a SELECT .. FROM ... WHERE ... START WITH ... CONNECT BY statement. It's as following:
INSERT INTO TAB_INS
SELECT T.TREE_ID, T.PARENT_ID, T.SDATE, T.SALARY
FROM TAB_TREE T
WHERE T.SDATE = '01-Jan-2004'
START WITH T.TREE_ID = 'rt'
CONNECT BY PRIOR T.TREE_ID = T.PARENT_ID;
I can run this selection query in only a few seconds and return nearly a million records. But when I put the "INSERT INTO TAB_INS' statement to insert the records into the table, it takes damn long time, and actually I suspect it is not going to stop. Is there anything wrong with this statement? Or is there any advice on this?
Comment