The problem with creating trigger with date type

lchlee

New Member
Hello,

I am first steps on Progress db. I try to create trigger.
There's no problem with trigger.
I think there's something with table which name is 'wo_mstr'.
In this table, there is column which name is 'wo_record_date'
wo_record_date's value is now sysdate.
I try to 'null' value, 'sysdate', 'systimestamp', '01/01/01' and so on.
However, it was useless.
I make test1 table which is exactly same with wo_mstr.
My trial was effective on test1 table.
What's problem with column 'wo_record_date'?
It's urgent question.
Please solve my problem as soon as possible.

Thanks in advance
Changlim Lee

=== Statement 1. ===
set schema 'PUB';


=== Statement 2. ===
insert into wo_mstr (
wo_nbr ,
wo_lot ,
wo_so_job ,
wo_ord_date ,
wo_rel_date ,
wo_due_date ,
wo_per_date ,
wo_record_date
)
select
'M0000011' ,
'M011' ,
wo_so_job ,
wo_ord_date ,
wo_rel_date ,
wo_due_date ,
wo_per_date ,
sysdate
from wo_mstr
where wo_lot = '523';
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-210022
[JDBC Progress Driver]:.

Errors 1.

=== Statement 3. ===
commit;


Statements: 3; Updates 0; Rows 0; Errors: 1; Warnings: 0. (8926)

For Test table

create table test1 (f1 date, f2 char(30), f3 char(30));
commit;

create table test1_ioilink(f1 date, f2 char(30), f3 char(30), create_time_ timestamp, create_sequence_ char(5));
commit;

CREATE TRIGGER tri_test1
before insert on test1
REFERENCING NEWROW
FOR EACH ROW
IMPORT
import java.sql.*;
BEGIN
Date f1;
String f2;
f1 = (Date) NEWROW.getValue(1, DATE);
f2= (String) NEWROW.getValue(2, CHAR);

SQLIStatement stmt = new SQLIStatement("insert into test1_ioilink (f1, f2, f3,create_time_, create_sequence_) values (?,?,'kk',systimestamp,1)");
stmt.setParam(1, f1);
stmt.setParam(2, f2);
stmt.execute();
END;
commit;

insert into test1 values(null, 'aa', 'bb');
commit;

select * from test1_ioilink;
Result f1='1950-05-02' f2='aa', f3='kk'

insert into test1 values(sysdate, 'bb', 'c');
commit;

select * from test1;
Result
f1 f2 f3
aa kk
2002-05-10 bb kk

select * from test1_ioilink;
Result
f1 f2 f3
1950-05-02 aa kk
2002-05-10 bb kk

insert into test1 values(systimestamp, 'cc', 'c');
commit;

select * from test1;
Result
f1 f2 f3
aa kk
2002-05-10 bb kk
2002-05-10 cc kk

select * from test1_ioilink;
Result
f1 f2 f3
1950-05-02 aa kk
2002-05-10 bb kk
2002-05-10 cc kk
 
Top