Error recovery happens only at the current production rule failure level and never at the production object level. A production rule that allows for error recovery should execute only one operation. Group components carefully when making production rules; for example, layout on paper how the output should look.
Below is a sample error recovery function. The input component is a field that can have a null value in the input transaction, but the output transaction requires a number that is four characters in length, left justified, and zero filled. The filter that would fail, and call this routine, is a table. Tables cannot contain null values and this is a simple way around the problem. In more critical areas, a different error recovery scheme could be used.
if (reason == 7)
{pb->set("0000");
// using the set blob method to replace the
// blob contents
return 1;
}
return 0;
Returning a 1 from an error function allows the production object to continue with the production rule following the one that failed. Components within the production rule that follow the error are not executed.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |