The second the use the for rec the main loop the code
|
|
---|
This role is granted to a user in the usual way:
grant password_protected to business_user;
set role password_protected identi
END OF STMT
112: 726f 6c65 2070 6173 7377 6f72 645f 7072 role password_pr
128: 6f74 6563 7465 6420 6964 656e 7469 6669 otected identifi
Securing Your Database |
---|
through roles granted at connection time and does it in a way that avoids hard coding or exposing the role password.
Preventing Application Access
ON DATABASE
begin
upper(rec.program) in ('MSACCESS.EXE','SQLPLUSW.EXE') then
RAISE_APPLICATION_ERROR(-20001,
/
There are two additional points of interest in this code. The first is the use of AUDSID � USERENV('SESSIONID')) to identify the currently connected session within the trigger. The second is the use of the FOR REC IN in the main loop of the code. You might ask why a loop construct is used when we only expect the query to return a single row containing the details of the connected session. The benefit of this