Hello list,

I'm trying to run a trigger on the following table

T_PHARMACOECONOMICS
id serial(10)...
...
visit_date date
oneyear_date date
fiveyear_date date
...

I need the values of oneyear_date and fiveyear_date be automatically
generated from the visit_date column. I wrote a trigger for insert which
works fine (generates properly the required columns), but the following
trigger for updates doesn´t (the values are not updated)

create trigger phec_trigup for WEBCTRL.T_PHARMACOECONOMICS after update
execute
(
    try
        update WEBCTRL.T_PHARMACOECONOMICS
        set oneyear_date =
MAKEDATE(YEAR(visit_date)-1,DAYOFYEAR(visit_date)), fiveyear_date =
MAKEDATE(YEAR(visit_date)-5,DAYOFYEAR(visit_date))
        where visit_date =:NEW.visit_date;
    catch
    if $rc <> 100
        then stop ($rc, 'unexpected error in trigger phec_trigup');
)

I am running MaxDB 7.5.00.23 Sparc 64bit on SunOS 5,9

Thanks, for the help

David

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to