Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRY ..CATCH and Insert Trigger
Message
From
28/07/2004 09:12:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
TRY ..CATCH and Insert Trigger
Miscellaneous
Thread ID:
00928663
Message ID:
00928663
Views:
63
* 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 ?
Next
Reply
Map
View

Click here to load this message in the networking platform