Plsql loops

From John Freier
Revision as of 15:13, 2 July 2013 by Jfreier (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Loop through a record set and use the records.

DECLARE

BEGIN

     FOR c_user IN (SELECT user_id, name FROM user)
     LOOP

          dbms_output.put_line('username:' || c_user.name);

     END LOOP;

END;