SQL insert cursors / Examples |
MAIN DEFINE i INTEGER DEFINE rec RECORD key INTEGER, name CHAR(30) END RECORD DATABASE stock DECLARE ic CURSOR FOR INSERT INTO item VALUES (rec.*) BEGIN WORK OPEN ic FOR i=1 TO 100 LET rec.key = i LET rec.name = "Item #" || i PUT ic IF i MOD 50 = 0 THEN FLUSH ic END IF END FOR CLOSE ic COMMIT WORK FREE ic END MAIN