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!

Using CONNECT BY LEVEL with For Loop Doesn't Work

722885Sep 16 2009 — edited Sep 17 2009
The procedure listed below inserts only one record in table whereas i need 10 records to be inserted in table.
this is just a test procedure..

CREATE OR REPLACE PROCEDURE P_TEST
AS

BEGIN
FOR I IN (SELECT LEVEL num FROM dual CONNECT BY LEVEL <= 10)
LOOP


INSERT INTO TEMP_VMS VALUES(I.num);
END LOOP;

END;
END;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2009
Added on Sep 16 2009
7 comments
1,132 views