Re: How to issue CREATE USER command from a stored proc?

From: Glenn Chambers <gchamber_at_bright.net>
Date: 1996/05/26
Message-ID: <gchamber-2605961939540001_at_tole-cs-2.dial.bright.net>#1/1


In article <31A82FCC.2DCC_at_hooked.net>, caharper_at_hooked.net wrote:

> I am trying to figure out how to execute a CREATE USER and
> GRANT commands from a stored proceedure. I would like to
> create the username (user_id) from a sequence generator, then
> GRANT create session to the new user. Does anyone know if this
> is possible? If so how I keep getting errors when I try.

All my references are at work, but I just did this. The key is a package called 'DBMS_SQL' or something similar. Look in the Server Concepts manual, I think. (It's on-line in the Personal Oracle I was working with.)

The basic idea is that you can open a 'cursor' inside the stored proc and then pass SQL that you've built up in a string variable to the package for execution. This is the only way to do DDL operations from a stored procedure.

-- 
Glenn Chambers
gchamber_at_bright.net
Toledo, OH
Received on Sun May 26 1996 - 00:00:00 CEST

Original text of this message