CREATE USER

From: Ludwig Mallia <lumar_at_fastnet.net.mt>
Date: 2000/05/05
Message-ID: <3912baef_at_news.waldonet.ent.mt>#1/1


I am trying to do a stored procedure using PL/SQL. Its function is to create a new user. When looking at the documentation, it said that this should be done using the parse statement. I created the following, compiled correctly but could not be run from DEV6.0. It is giving me error 905.

The following is my code

CREATE Or Replace PROCEDURE create_user (usr_name in Varchar2, usr_pass in Varchar2,usr_role IN VARCHAR2) AS

   cid INTEGER;
BEGIN
/* Open new cursor and return cursor ID. */

   cid := DBMS_SQL.OPEN_CURSOR;

/* Parse and immediately execute dynamic SQL statement built by

      concatenating table name to DROP TABLE command. */

   DBMS_SQL.PARSE(cid, 'CREATE USER ' || usr_name, dbms_sql.v7);
   DBMS_SQL.PARSE(cid, 'IDENTIFIED BY ' || usr_pass, dbms_sql.v7);
   DBMS_SQL.PARSE(cid, 'Profile ' || usr_role, dbms_sql.v7);

/* Close cursor. */

   DBMS_SQL.CLOSE_CURSOR(cid);

EXCEPTION
/* If an exception is raised, close cursor before exiting. */

   WHEN OTHERS THEN

      DBMS_SQL.CLOSE_CURSOR(cid);
      RAISE;  -- reraise the exception

END create_user;


can any one help me?

cheers,
Ludwig Received on Fri May 05 2000 - 00:00:00 CEST

Original text of this message