Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counter does not work in the procedure

Status
Not open for further replies.

shyamal

Programmer
Aug 14, 2000
79
US
Hi,

For this stored procedure, I cannot make the counter work, any ideas? The table becomes populated with five 1's what I want is that the table is populated with 1,2,3,4,5.

DECLARE
i INTEGER := 1;
BEGIN
WHILE (i <= 5)
LOOP
insert into SLEONARD.T00 (RECID) values (1);
COMMIT;
insert into SLEONARD.T50 (RECID) values (1);
COMMIT;
i := i + 1;
END LOOP;
END;
 
Hi,

In your insert statements, the value should be i (not 1)... :eek:)

Rgds,
Did02
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top