Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TRY ..CATCH and Insert Trigger
Message
De
28/07/2004 09:12:10
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
TRY ..CATCH and Insert Trigger
Divers
Thread ID:
00928663
Message ID:
00928663
Vues:
62
* 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
Fil
Voir

Click here to load this message in the networking platform