Re: Creating users via PL/SQL

From: Andrew Zitelli <zitelli_at_tus.ssi1.com>
Date: 1995/10/24
Message-ID: <46jt0d$mi8_at_atlas.tus.ssi1.com>#1/1


dstrait_at_omni.voicenet.com wrote (with deletions):

>

> I am trying to write a small package to create a user. While I can get
> this to work through a script, PL/SQL doesn't seem to know how to deal
> with the keywords CREATE or GRANT. I've looked through the PL/SQL
> User's guide and grepped through the scripts that Oracle installs,
> but I can't find anything about creating users in a package. Can
> someone point me in the correct direction?

Your ability to do this will depend on which version of Oracle and PL/SQL you are using. If you are using PL/SQL Version 2 and Oracle 7.1, you can create new users in PL/SQL by using built in packages supplied by Oracle. In particular you will use the package "dbms_sql" to execute dynamic sql statements inside PL/SQL. The technique for executing dynamic SQL is illustrated in the Oracle7 Server Documentation Addendum for Version 7.1, chapter 7. A better reference is "Oracle PL/SQL Programming" by Steven Feuerstein, published by O'Reilly & Associates, September 1995. I have a working example of a stored procedure which creates new users. Unfortunately, my server is being upgraded to Oracle 7.2 today and is unavailable. I will e-mail you a copy of the procedure in the next couple of days.

As a point of interest, O'Reilly's home page on the web can be found at:

                   http://www.ora.com/index.html
Received on Tue Oct 24 1995 - 00:00:00 CET

Original text of this message