Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00604/ORA-01422/ORA-06512 Error on trigger

644317Mar 19 2009 — edited Mar 23 2009
Hi,

I have an database which is of version 10.2.0.3.0 on Enterprise Edition.
I want to restrict a user from usage of an schema . Therefore i have written a trigger but i have encountered with another errors:

ORA-00604: error occurred at recursive SQL level 1
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 5

Trigger Being::
--------------------

SQL> create or replace trigger session_access
2 after logon on database
3 declare
4 v_username varchar2(30);
5 v_osuser varchar2(30);
6 begin
7 select username,osuser into v_username,v_osuser from v$session;
8 if v_username = 'SUSANJO' and v_osuser= 'ORACLE' then
9 raise_application_error (-20001,'Access restricted for this USER');
10 end if;
11 end;
12 /

Trigger created.

SQL> show errors;
No errors.
SQL> connect susanjo
Enter password:
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 5


Warning: You are no longer connected to ORACLE.

i have run out of ideas of whats to be done onto the trigger now.

Regards.
Susan John
This post has been answered by MichaelS on Mar 23 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2009
Added on Mar 19 2009
18 comments
7,531 views