Skip to end of metadata
Go to start of metadata

Overview

ALTIBASE HDB has constraints as below while using trigger.

  • does not support system trigger (Schema trigger, Database trigger). and does not support DDL trigger.
  • does not support Instead of trigger, Compound DML trigger 
  • In ORACLE, the triggering event of a DML trigger comprises multiple triggering statements. (using insert, update, delete statements)
    But ALTIBASE HDB can't be done like that. ALTIBASE HDB Trigger event has to be written for each statement.
  • does not support RENAME clause(to rename the trigger)
    Icon

    "Before update trigger" feature has been applied at ALTIBASE HDB V6.

Example

ORACLE

ALTIBASE

Comments

CREATE OR REPLACE TRIGGER trg_orders
AFTER UPDATE ON orders
REFERENCING OLD old
FOR EACH ROW
BEGIN
INSERT INTO orders_trg VALUES(:old.ono, :old.eno);
END;
/

CREATE OR REPLACE TRIGGER trg_orders
AFTER UPDATE ON orders
REFERENCING OLD ROW old_row
FOR EACH ROW
AS BEGIN
INSERT INTO orders_trg VALUES(old_row.ono, old_row.eno);
END;
/

On the left side,
In ALTIBASE HDB, OLD ROW keyword
should be used instead of OLD.

In addition, AS keyword is required in Altibase HDB unlike in Oracle.
and in a VALUES clause, semi colon(indicating value specified in the referencing clause)
is essential.

CREATE OR REPLACE TRIGGER trg_orders_ins
AFTER INSERT ON orders
REFERENCING NEW NEW
FOR EACH ROW
BEGIN
INSERT INTO orders_trg VALUES(:old.ono, :old.eno);
END;
/

CREATE OR REPLACE TRIGGER trg_orders_ins
AFTER INSERT ON orders
REFERENCING NEW ROW new_row
FOR EACH ROW
AS BEGIN
INSERT INTO orders_trg VALUES(new_row.ono, new_row.eno);
END;
/

almost same above


For the rest of the differences between ALTIBASE HDB and Oracle on trigger, See PL/SQL Conversion part for more details. 

That's why  the most of the differences between Altibase and Oracle are in the trigger_action part.

  • No labels