Actions:
|
2012-02-21 13:21 AEST by Arthur Barrett - We currently have a db2 database plugin, but a quick test with IBM DB2 Workgroup Edition 9.7 on
Windows XP shows it doesn't work with audit:
13:08:38: S -> InitTrigger(audit.dll)
13:08:38: S -> Insert Into SessionLog (Command, StartTime, Hostname, Username, SessionId,
VirtRepos, PhysRepos, Client) Values (?,'2012-02-21 13:08:38',?,?,'a144f42fca55368',?,?,'CVSNT 2.8.01
(Soolin) Build 4440')
13:08:38: S -> begin atomic;Insert Into SessionLog (Command, StartTime, Hostname, Username,
SessionId, VirtRepos, PhysRepos, Client) Values (?,'2012-02-21
13:08:38',?,?,'a144f42fca55368',?,?,'CVSNT 2.8.01 (Soolin) Build 4440') select identity_val_local(); end
13:08:38: S -> audit_trigger error (session)
The correct insert command appears to be:
begin atomic Insert Into SessionLog (Command, StartTime, Hostname, Username, SessionId, VirtRepos,
PhysRepos, Client) Values ('test','2012-02-21
13:08:38','host','user','a144f42fca55368','virt','phys','CVSNT 2.8.01 (Soolin) Build 4440'); select
identity_val_local() from SessionLog; end
------------------------------ Commands Entered ------------------------------
begin atomic Insert Into SessionLog (Command, StartTime, Hostname, Username, SessionId, VirtRepos,
PhysRepos, Client) Values ('test','2012-02-21
13:08:38','host','user','a144f42fca55368','virt','phys','CVSNT 2.8.01 (Soolin) Build 4440'); select
identity_val_local() from SessionLog; end;
------------------------------------------------------------------------------
begin atomic Insert Into SessionLog (Command, StartTime, Hostname, Username, SessionId, VirtRepos,
PhysRepos, Client) Values ('test','2012-02-21
13:08:38','host','user','a144f42fca55368','virt','phys','CVSNT 2.8.01 (Soolin) Build 4440'); select
identity_val_local() from SessionLog; end
DB20000I The SQL command completed successfully.
But I'm not sure if the select identity_val_local() from SessionLog; is really successfully returning
something... |
|
2012-02-21 13:49 AEST by Arthur Barrett - Or maybe:
begin atomic Insert Into SessionLog (Command, StartTime, Hostname, Username, SessionId, VirtRepos,
PhysRepos, Client) Values ('test','2012-02-21 13:08:38','host','user','a144f42fca55368','virt','phys','CVSNT
2.8.01 (Soolin) Build 4440'); select max(identity_val_local()) from SessionLog; end
But most likely I need to create an procedure which does the insert and returns the value of the key, then
call the procedure... |