On 03/09/2014 13:21, Knut Anders Hatlen wrote:
I don't think so. Derby doesn't allow UPDATE statements in BEFORE
triggers
I was meaning to just set the column value from the sequence into the
new values, not using an insert statement. In my Oracle version its like
this:
CREATE OR REPLACE TRIGGER samples_code_trg BEFORE INSERT ON samples
FOR EACH ROW
BEGIN
SELECT TO_CHAR(seq_sample_code.nextval) INTO :NEW.sample_code FROM
dual; END;
I've never had much joy with BEFORE INSERT triggers on Derby.
Thanks
Tim