Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: create user in PL/SQL package e.t.c.
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 - 09:30:39 CDT