Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: create user in PL/SQL package e.t.c.

Re: create user in PL/SQL package e.t.c.

From: Tanel Poder <change_to_my_first_name_at_integrid.info>
Date: Tue, 16 Sep 2003 18:34:03 +0300
Message-ID: <3f672d6c$1_1@news.estpak.ee>


Well, this sqlplus command executes a very PL/SQL command which can be put into PL/SQL package. I don't have that much time to write a complete solution for OP (and I never will), but my post should be good enough for providing the right direction to continue with.

Tanel.

  "Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message news:1063722628.793817_at_yasure...   Tanel Poder wrote:

Hi!

  1. How I can create user inside PL/SQL package? If it is not possible, give tips.
  2. How I can get roles and system privileges granted to user?

SQL> exec execute immediate 'create user y identified by y';

PL/SQL procedure successfully completed.

SQL> exec execute immediate 'grant create session to y';

PL/SQL procedure successfully completed.

SQL> connect y/y
Connected.
SQL> Tanel.
  I'd suggest reading a bit more carefully ... the SQL*Plus command line hardly qualifies as a PL/SQL package.

  The only solution to what the OP asked is dynamic SQL to handle CREATE USER and the grants.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Sep 16 2003 - 10:34:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US