Hi all,

We finally found a solution for our problem:

- we changed our timestamp columns from date type to timestamp type
- we changed the trigger to be effective only when a new timestamp value is not 
brought by the insert or update request itself:

CREATE OR REPLACE TRIGGER UPD_INS
  | 
  | BEFORE INSERT OR UPDATE
  | 
  | ON MY_TABLE 
  | 
  | REFERENCING NEW AS NEW OLD AS OLD
  | 
  | FOR EACH ROW
  | 
  | begin
  | 
  |        if :new.tstamp is null or 
  | 
  |             :new.tstamp = :old.tstamp then
  | 
  |                   :new.tstamp:=sysdate;
  | 
  |        end if;
  | 
  | end;

It seems to be working. Did anybody already try this kind of stuff and do you 
see any problem related to this solution?

Thanks for your efforts,

fred

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878243#3878243

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3878243


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to