db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrzej Kasprzyszyn <andrzej.kasprzys...@gmail.com>
Subject Create trigger with 2 sql statements
Date Mon, 23 Aug 2010 09:52:07 GMT
Hi All

I would like to create following trigger

CREATE TRIGGER COUNTRY_TRG
AFTER INSERT ON COUNTRY
DELETE FROM aTable WHERE table_name = 'country'
INSERT INTO aTable(table_name, msg) VALUES('country', current_timestamp)


I am receiving syntax error:

 11:40:55  [CREATE - 0 row(s), 0.000 secs]  [Error Code: -1, SQL
State: 42X01]  Syntax error: Encountered "INSERT" at line 4, column 1.
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time:
0.000/0.000 sec [0 successful, 0 warnings, 1 errors]


Is it possible that Derby doesn't allow two sql statements in triggers action?

Thanks in advance,
Andrzej

Mime
View raw message