Friday, 25 January 2013

Basic PL/SQL for listing all user in a DB..


Basic PL/SQL anonymous code for listing all user in a DB..



declare

 CURSOR cur 
    IS 
    select username from dba_users order by username;
    cnt   NUMBER;
    rd    cur%ROWTYPE;

BEGIN   
    OPEN cur;
    LOOP
        FETCH cur into rd;
       EXIT WHEN cur%NOTFOUND;

    DBMS_OUTPUT.put_line (rd.username);

    END LOOP;
      CLOSE cur;
      END;


********************

No comments:

Post a Comment