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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Error while executing stored procedure as system user - Solved

RE: Error while executing stored procedure as system user - Solved

From: Ranganath K <ranganathk_at_subexgroup.com>
Date: Tue, 29 May 2001 04:07:28 -0700
Message-ID: <F001.00311977.20010529040543@fatcity.com>

Dear DBA Gurus,

I solved the problem by incorporating the authid current_user clause. I didn't explicitly grant any roles or privileges to system user. The modified code is as
below:

create or replace procedure create_user (name IN VARCHAR2) authid current_user
IS
BEGIN
   EXECUTE IMMEDIATE 'create user ' ||name||' '||'identified by '||name||' '||

   'default tablespace users temporary tablespace temp';

   EXECUTE IMMEDIATE 'grant connect, resource to ' ||name;
   EXECUTE IMMEDIATE 'create table '||name||'.aaa(a number)';
   EXECUTE IMMEDIATE 'create table '||name||'.bbb(b number)';
END; Thanks Amol Joshi for giving the suggestion to use auth_id current_user clause in the stored procedure code.

Regards,

Ranganath

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Ranganath K
  INET: ranganathk_at_subexgroup.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue May 29 2001 - 06:07:28 CDT

Original text of this message

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