Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL
PL/SQL [message #2834] Fri, 16 August 2002 03:13 Go to next message
Christine Pollhaus
Messages: 18
Registered: May 2002
Junior Member
Please help from anyone:

I created a stored procedure like the following:
_________________________________________________
CREATE OR REPLACE
PROCEDURE neu_user (User_in IN VARCHAR2, PW_in IN VARCHAR2, DTS_in IN VARCHAR2, TTS_in IN VARCHAR2)
IS
curs INTEGER;
erg INTEGER;
BEGIN
curs := dbms_sql.Open_Cursor;
dbms_sql.parse (curs, 'CREATE USER '||user_in||' IDENTIFIED BY '||PW_in||' ', dbms_sql.native);
erg := dbms_sql.execute(curs);
EXCEPTION
WHEN OTHERS THEN
DBMS_sql.close_cursor(curs);
RAISE;
END;
____________________________________________________

When I want to execute this procedure in SQL*PLUS it says:

ORA-Error No 01031 (Insufficient privileges) and
ORA-Error No 06512 (Errorin Line 1 and Error in Line 17

What goes wrong, why doesn't that work, compliation says that the procedure is valid ???

Thanks for any help!!!
Re: PL/SQL [message #2837 is a reply to message #2834] Fri, 16 August 2002 03:40 Go to previous messageGo to next message
Keith
Messages: 88
Registered: March 2000
Member
I think this may be similar to a response I posted yesterday......try explicitly granting create user privilege to your user before executing the proc through SQL*Plus (even if your user already has create user privilege).

Let me know if this works
Re: PL/SQL [message #2840 is a reply to message #2834] Fri, 16 August 2002 04:12 Go to previous messageGo to next message
Christine
Messages: 18
Registered: March 2002
Junior Member
Hi,
thanks a lot for your help!!! It did work!!!
Anyhow, I do not understand why because the user who owns and executes this proc has sysdba privilege!
Is it always like this? is it a bug in ora? I have 8.1.7.3 on windows 2000!
Re: PL/SQL [message #2847 is a reply to message #2840] Fri, 16 August 2002 09:21 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
No, it is not a bug. Remember that SYSDBA is a role, albeit a powerful one, and that, as Keith mentioned, you cannot execute something in a privilege without having a direct grant. Even though this user has SYSDBA, this user still needed the direct grant to 'create user'.
Previous Topic: dates again
Next Topic: Fixing data
Goto Forum:
  


Current Time: Thu Apr 25 06:50:53 CDT 2024