Information générale
Titre:
TRY ..CATCH and Insert Trigger
* location.dbf - parent table
* cardhdr.dbf - child table with the field LOCATION_KEY as a foreign key
* the referential integrity between 2 tables is setup as Restricted
* with generated insert trgger
* The INSERT command works fine
INSERT INTO cardhdr ( pk_field, location_key) ;
VALUES (10, NULL)
* The INSERT failed when called from TRY...CATCH block
* Reason:
* procedure PROCEDURE __RI_INSERT_cardhdr
* gives 'Data type mismatch' error at the line
llRetVal=SEEK(lcChildID,lcParentWkArea)
Without TRY...CATCH the error is trapped by ON ERROR command
that just log the error and allow to continue ( llRetVal is .T. )
WITH TRY ...CATCH the control returns to the calling program leaving
the transaction open and never executing RIEND procedure
Is the only option is to put every trigger procedure inside its own TRY..CATCH ?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement