Mark Thomas wrote : >Hello,
>I have run into a problem with a trigger that I can't solve. I am trying to archive rows that are deleted out of one table into another table. I have two tables and one trigger that look like this: >create table foo (fooint integer primary key, footext char(64), foodate date) and >create table fooarchive(fooint integer not null, footext char(64), foodate date, fooupdate timestamp, foouser varchar(32)) >and one trigger: >create trigger foo_upd for myuser.foo after delete execute ( > try > insert into myuser.fooarchive values( :old.fooint, :old, footext, :old.foodate, timestamp, user); > catch > if $rc <> 0 then stop ($rc, $errmsg); >) >This approach works fine except for the date field. When that field was added, the trigger failes >with a message -3048 Invalid date format: ISO. I have tried changing the DATE_TIME_FORMAT parameter >to INTERNAL, USA, ISO, etc. but that doesn't alleviate the problem. I still cannot select a date >from one date field and insert it into another date field within a trigger. Does anyone see what I'm >missing? This is a known problem, that occurs with triggers and stored procedures using date/time/timestamp variables as parameters of sql statements. The problem is, that the variables are in format internal and are not transformed into the required session format. We will fix this with the next version. Till then I recommend to use the data type CHAR(8) instead of data type CHAR. Thomas --- Thomas Anhaus SAPDB, SAP Labs Berlin _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
