Home » SQL & PL/SQL » SQL & PL/SQL » Procedure to create a new user and list the new user in a table
Procedure to create a new user and list the new user in a table [message #40000] Tue, 03 September 2002 05:16 Go to next message
Christine Pollhaus
Messages: 18
Registered: May 2002
Junior Member
Hi everybody,

I wrote my proc like this:
CREATE OR REPLACE
PROCEDURE NEWUSER (user_in IN CHAR, pw_in IN CHAR, name_in IN CHAR)
IS
BEGIN
EXECUTE IMMEDIATE
'CREATE USER '||user_in||' IDENTIFIED BY '||pw_in||' DEFAULT TABLESPACE PROFILE_C TEMPORARY TABLESPACE TEMP ';
EXECUTE IMMEDIATE
'GRANT STANDARD_USER TO '||user_in||' ';
EXECUTE IMMEDIATE
'INSERT INTO PFC_BWV_ANWENDER (USER_ID, USER_NAME, SPRACHE, THEMA, DATEN_GRP) VALUES ('||user_in||' , '||name_in||' , spr , th , grp) ' ;
END;

On complation Ora says VALID but on execution SQL*PLUS says:

SQL> execute newuser ('TEST', 'Dr. Helmut Test', 'TEST')
BEGIN newuser ('TEST', 'Dr. Helmut Test', 'TEST'); END;

*
FEHLER in Zeile 1:
ORA-00922: Fehlende oder ungültige Option
ORA-06512: in "PROFILEC.NEWUSER", Zeile 4
ORA-06512: in Zeile 1

what went wrong ????

Any help available ???
Re: Procedure to create a new user and list the new user in a table [message #40003 is a reply to message #40000] Tue, 03 September 2002 06:39 Go to previous message
Rick Cale
Messages: 111
Registered: February 2002
Senior Member
I would try a much simplier test case.
Passing 'Dr. Helmut Test' in as the password is suspect. You have to pass it in surrounded by double
quotes. First of all I would pass in a single word password with no special characters.
Previous Topic: Alter SYS & SYSTEM user on any database
Next Topic: Partitions....
Goto Forum:
  


Current Time: Fri Apr 26 12:53:39 CDT 2024