This question is locked. New answers and comments are not allowed.
Hi,
I am using the visual designer to model my entities and one my entities is using oracle sequence and trigger to insert the PK field value.I used OpenAccess Data source to bind the FormView control to my entity.When the formview inserts the record, everything is fine except that the primary key value is inserted as 0 .The OA should actually pass null value, so that my trigger can do the sequence insert.
CREATE OR REPLACE TRIGGER INVENTORY.TRG_INVENTORY_MOVEMENTS_ID before insert on "INVENTORY_MOVEMENTS" for each row |
begin if inserting then if :NEW."ID" is null then select SEQ_INVENTORY_MOVEMENTS_ID.nextval into :NEW."ID" from dual; end if; end if; end; |
/ |
Your help is much appreciated.
Thanks