Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sql plus or toad not responding.

633180Dec 3 2008 — edited Dec 3 2008
Hi,


I have to insert million rows to table to another table.

I have written oracle cursor for this requirement, when I am executed the procedure it’s interesting the million rows but sql puls or toad are not responding long time and come up with alert message like “Cursor must be opened”.

Please help me, why sql plus or toad are not responding long time and find the procedure below.

CREATE OR REPLACE PROCEDURE test_Proc AS

rcounttemp INTEGER := 1;
v_test table.test%TYPE;
v_test1 table.test1%TYPE;

Cursor test is Select test, test1 From table Where trunc(testDate) = trunc(sysdate)
AND testperiod = 'N';

BEGIN
OPEN test;
Loop
FETCH test INTO v_test, v_test1;

EXIT WHEN test%NOTFOUND;

Insert Into test2
(
test, test1
) Values (
v_test, v_test1
);

IF (MOD (rcounttemp, 10000) = 0) THEN
rcounttemp := 0;
COMMIT;
END IF;

rcounttemp := rcounttemp + 1;

END LOOP;

CLOSE test;

COMMIT;

END;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2008
Added on Dec 3 2008
3 comments
2,265 views