home *** CD-ROM | disk | FTP | other *** search
- rem
- rem $Header: sample1.sql,v 1002100.2 90/01/11 17:02:04 nsalah Exp $ sample1.sql Copyr (c) 1989 Oracle
- rem
- rem V6PLS10021,DISK$DEV9:[PLS.DEMO.10021]
- /*
- ** This uses a simple FOR loop to insert 10 rows into a table.
- ** The values inserted consists of two counter variables and one
- ** of two possible character strings. Which string is inserted
- ** is determined by whether the first counter variable is even
- ** or odd.
- **
- ** Copyright (c) 1989 by Oracle Corporation
- */
-
- DECLARE
- x NUMBER := 100;
- BEGIN
- FOR i IN 1..10 LOOP
- IF MOD(i,2) = 0 THEN -- i is even
- INSERT INTO temp VALUES (i, x, 'i is even');
- ELSE
- INSERT INTO temp VALUES (i, x, 'i is odd');
- END IF;
-
- x := x + 100;
- END LOOP;
- COMMIT;
- END;
- /
-