Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create user through procedure on another database via database link

RahulJoshiJan 13 2015 — edited Jan 17 2015

I'd like to create users through procedure on another database via database link:

Here are the code which i used:

create or replace

PROCEDURE createuser(user_name in VARCHAR2, pass_word in VARCHAR2)

IS

BEGIN

      dbms_utility.exec_ddl_statement@rahul('CREATE USER'||user_name||'IDENTIFIED BY'||pass_word||' DEFAULT TABLESPACE USERS PROFILE DEFAULT ACCOUNT UNLOCK');

   END createuser;

/

when executing it i got an error:

ORA-00901: invalid CREATE command
ORA-06512: at "SYS.DBMS_UTILITY", line 574
ORA-06512: at "SYS.CREATEUSER", line 4
ORA-06512: at line 1


How to resolve it?


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2015
Added on Jan 13 2015
16 comments
3,428 views