create logon trigger
Date: Fri, 25 Apr 2008 13:52:34 -0700 (PDT)
I want to maintain a table, so that if people in this table, they can logon using sqlplus, if they are not, they can only logon through our application server.
this trigger works fine
CREATE OR REPLACE TRIGGER rds_logon_trigger 2 AFTER LOGON ON DATABASE
4 IF SYS_CONTEXT('USERENV','IP_ADDRESS') not in ('192.168.2.1','192.168.2.2','192.168.2.3') THEN 5 RAISE_APPLICATION_ERROR(-20003,'You are not allowed to connect to the database');
6 END IF;
But if i want to use a query, I got an error
CREATE OR REPLACE TRIGGER rds_logon_trigger AFTER LOGON ON DATABASE
IF SYS_CONTEXT('USERENV','IP_ADDRESS') not in (select '1' from dual) THEN
RAISE_APPLICATION_ERROR(-20003,'You are not allowed to connect to the database');
2/47 PLS-00405: subquery not allowed in this context
Is there any way I can achieve what i wanted?
Thanks for your help Received on Fri Apr 25 2008 - 15:52:34 CDT