Hi All,
I have a Table (STDTable) with 3 columns: STDAccount, STDpassword, IRowId.
I am getting a user conflicts error when I 'get the next' user info from the table. I am using SQLDeveloper.
Below is the procedure and the error that follows. I understand I should not be creating users in the sys schema, but I am still learning and don't know how to make a new schema to put these users into. So for now, this is what I am doing. I changed this procedure from one I had, this time using a cursor.
THANK YOU for any help or guidance.
brig
CREATE OR REPLACE PROCEDURE MakeNewStudents
IS
--Declare, don't select rows yet
CURSOR stdCurSor IS
SELECT iRowId,
stdAccount,
stdPassword
FROM sys.stdTable;
iLoopCount INT := 1;
InexTrowId INT := 1;
iCurrentRowId INT := 0;
iRowCount INT := 0;
iRowNo INT := 0;
vchaccounName VARCHAR2(7) := '';
vchPasswordnmbr VARCHAR2(9) := '';
BEGIN
OPEN stdCurSor;
LOOP
FETCH stdCurSor INTO iRowNo,
vchaccounName,
vchPasswordnmbr;
dbms_Output.Put_Line('Is ther an Name ? '
||vchaccounName);--testing
EXIT WHEN stdCurSor%NOTFOUND;
IF iRowNo = InexTrowId THEN
InexTrowId := InexTrowId + 1;
EXECUTE IMMEDIATE 'CREATE USER vchACCOUNName
IDENTIFIED BY vchPasswordNmbr
DEFAULT TABLESPACE STUDENTTABLESPACE
QUOTA 10M ON example
QUOTA 10M ON system';
END IF;
iRowCount := stdCurSor%ROWCOUNT;
dbms_Output.Put_Line('Number of Rows '
||iRowCount); --testing
END LOOP;--in FOR
CLOSE stdCurSor;
END;--procedure
Connecting to the database Brig.
ORA-01920: user name 'VCHACCOUNNAME' conflicts with another user or role name
ORA-06512: at "SYS.MAKENEWSTUDENTS", line 26
ORA-06512: at line 2
Is ther an Name ? ada6464
Number of Rows1
Is ther an Name ? hol3743
Process exited.
Disconnecting from the database Brig.