Home » SQL & PL/SQL » SQL & PL/SQL » Can We Create a user of our choise entered through Parameters of a Procedure.
Can We Create a user of our choise entered through Parameters of a Procedure. [message #39010] Thu, 06 June 2002 09:29 Go to next message
Sheshadri
Messages: 12
Registered: June 2002
Junior Member
Hi friends,
Pl let me know how to create an user of our choise through PL/SQL.
I want to pass the username and password through the Parameters of a procedure.
Thanks & Regards.
Sheshadri
Re: Can We Create a user of our choise entered through Parameters of a Procedure. [message #39013 is a reply to message #39010] Thu, 06 June 2002 10:20 Go to previous message
magvivek@yahoo.com
Messages: 1
Registered: June 2002
Junior Member
here you go.
you can similarly add other specificaions like the tablespace name, temp tablespace name etc

SQL> ed
Wrote file afiedt.buf

  1  create or replace procedure create_user
  2     (name in varchar2,
  3     pass  in varchar2)
  4  authid current_user
  5  as
  6     str varchar2(300);
  7  begin
  8     str:='create user '||name ||' identified by '|| pass ;
  9     execute immediate str;
 10* end;
SQL> /

Procedure created.

SQL>  EXEC CREATE_USER('NEWUSER','PASSWORD');

PL/SQL procedure successfully completed.
Previous Topic: verifying whether or not a table exists
Next Topic: What is wrong with my logic?
Goto Forum:
  


Current Time: Wed Apr 24 19:47:06 CDT 2024