Rem    RETURNS
Rem
Rem    NOTES
Rem      filename renamed from sample1.sql to pls_sample1.sql
Rem    MODIFIED   (MM/DD/YY)
Rem     rolawson   04/03/09  - moved from sample_code/plsql/scripts to
Rem                            sample_code/plsql
Rem     rolawson   03/04/09  - initial checkin of quickstart files
Rem     nmeng      11/29/06  - added pls_ prefix to filename
Rem     jmuller    05/28/99 -  Fix bug 708690: TAB -> blank
Rem     rvasired   05/12/92 -  Creation
/*
** This block uses a simple FOR loop to insert 10 rows into a table.
** The values of a loop index, counter variable, and either of two
** character strings are inserted.  Which string is inserted
** depends on the value of the loop index.
**
** Copyright (c) 1989,1992, 1999 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;
/

