The key player is SYS_CONTEXT as in:
Select SYS_CONTEXT('USERENV','IP_ADDRESS') FROM dual
Here's a trigger that captures the ip addresses of clients deleting rows from a table:
CREATE OR REPLACE TRIGGER "MYSCHEMA"."SESSIONWATCHER" BEFORE
DELETE ON "MYSCHEMA"."CURRENTUSERSESSION" DECLARE
SInfo MYSCHEMA.SESSIONHISTORY.INFO%TYPE;
BEGIN
SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') INTO SInfo FROM dual;
INSERT INTO MYSCHEMA.SESSIONHISTORY VALUES (SInfo);
END SessionWatcher;
Subscribe to:
Post Comments (Atom)
C# Sucks!
JK!! Seriously, though, somewhere around C#-3 we should have inculcated ourselves with the question: "Does 'CAN' == 'SHOULD...
-
Have now wasted several hours downloading and evaluating SQL Test Data Generators. The only one that actually 'worked' doesn't ...
-
That pesky problem has reared its ugly head again! I remembered that its a permissions problem but forgot the wrinkle where you have to REMO...
No comments:
Post a Comment