Hello,
I imported the file with date values .... since I dont know any possibility how to import value like '20080429' as date directly I imported the column as char and now I would like to setup trigger or counted column which will convert the char to date for me.
I wrote the trigger:
BUT - I am getting error :
During SQL processing it returned:
... since I wrote it following the syntax on IBM pages I dont have any idea what can be wrong there ...
Thanks a lot for help.
I imported the file with date values .... since I dont know any possibility how to import value like '20080429' as date directly I imported the column as char and now I would like to setup trigger or counted column which will convert the char to date for me.
I wrote the trigger:
Code:
CREATE TRIGGER SCANTIME AFTER INSERT ON xxx.ASSET_REPORT FOR EACH ROW UPDATE xxx.ASSET_REPORT BEGIN SET SCAN_DATE = CASE WHEN SCANTIME_DATE IS NULL THEN 'MISSING' WHEN SCANTIME_DATE IS NOT NULL THEN TO_DATE (SCANTIME_DATE,'YYYYMMDD') END;
During SQL processing it returned:
Code:
SQL0171N The data type, length or value of argument "2" of routine "SYSIBM.TO_DATE" is incorrect. LINE NUMBER=2. SQLSTATE=42815
Thanks a lot for help.
Comment