Hi friends this is the code for the dynamic creation of user in plsql, but these statements are not run if pls help for this error

DECLARE

n NUMBER.

BEGIN

n: = 1;

WHILE (n < = 10)

LOOP

CREATE a user EM | IDENTIFIED BY KLU n;

SESSION CREATION GRANT, GRANT ANY PRIVILEGE TO EM. n;

COMMIT;

n: = n + 1;

END LOOP;

END;

Hello

Here is the dynamic creation of user query and giving grants to the user,.

DECLARE

n NUMBER.

cr_user VARCHAR2 (300);

gr_user VARCHAR2 (300);

BEGIN

n: = 1;

While (n<=>

LOOP

cr_user: = 'CREATE user EM | n | "IDENTIFIED BY KLU";

gr_user: = "GRANT CREATE SESSION, GRANT ANY PRIVILEGE to EM '. n | '';

EXECUTE IMMEDIATE cr_user;

EXECUTE IMMEDIATE gr_user;

n: = n + 1;

END LOOP;

END;

Edited: Removed when OTHER exceptions to Code.

See you soon!

Tags: Database

Similar Questions

Maybe you are looking for

  • Right-click menu navigation that gives?

    These past few days Firefox has been giving me a menu when I right click. It is a large menu with navigation options (forward, backward, charging, bookmark). I don't like it and want to get out and go back to what it was. =/

  • SWOP AZERTY keyboard

    At any a changed/two-way on the QWERTY keyboard on a laptop computer configured french (HP Pavilion dv7-7190sf) for a standard QWERTY keyboard?  or vice versa.  Is this possible?  Are the dimensions and the same fittings?

  • Removal of Extended Partition

    I'm unable to reduce an extended partition in order to enlarge a primary partition (drive C). So I want to remove the extended partition and its unallocated space after the removal of several logical volumes. After developing my C drive, I re-create

  • Smartphones blackBerry 9900 brick update

    My camera got bricks to update. Stuck at "connecting to the boot ROM. Device is dead, does not answer something, says the Device Manager to change the settings in the control panel computer followed the steps, nothing helps. Device connection and rec

  • Unable to connect to the desktop computer running Windows 7 laptop running Windows 7, both in my home network, using remote desktop

    My desktop (host) is running Win7 Pro and my (client) laptop is running Win 7 Home Premium. For the office, I went to the control panel and allows remote connections. When I try to connect with the laptop in my same home network, I get an error messa