Consultor Eletrônico



Kbase 21729: CRC for Database Trigger Proc. Does Not Match Schema (3242)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/01/2002
SUMMARY:

This Solution describes conditions that might bring about error 3242, and shows you how to resolve the problem.

CRC for database trigger procedure <procedure> does not match
schema. (3242)

EXPLANATION:

Switching on CRC for a database trigger is intended to prevent counterfeit triggers. Changing a trigger content without reregistering in the database will cause error 3242.

These steps will reproduce the error:

1) Create sports database with 8.3A.
2) Start the server for the sports database.
3) Copy the contents of the delete trigger for the customer table
into the 8.3A Procedure Editor.
4) Save that to a .p file.
5) Using the Data Dictionary, choose the new trigger file.
6) Set CRC check to on.
7) Compile and save the trigger.
8) Go into the 9.1B Procedure Editor and compile the same trigger
into 9.1B.
9) Delete the last record of the customer table.
10) Edit the delete trigger procedure; for example, add a line which
declares a variable.
11) Compile and save that trigger.
12. Delete the last record of the customer table. You should see
error (3242)

NOTE: reading the source file with different character sets for
the database and the Procedure Editor (reference -cpinternal and -cpstream) may cause different characters to appear, especially with ascii values above 128, and that can be a cause for different CRCs.

SOLUTION:

Reregister the trigger by going into Data Dictionary table properties for the specific table.

-- Triggers > under Event, choose the trigger type (example, DELETE)

-- Under Procedure, use the files button to choose your trigger
source .p file.

Before compiling the trigger make sure the trigger contents appear the same within the database and the Procedure Editor.

Example:

1) In the 8.3A Data Dictionary > customer table properties >
triggers, under Event choose Delete. Under Procedure, use the
files button to choose your trigger source .p file.
Save and commit changes.

2) In the 9.1B Procedure Editor, compile and save your trigger
source .p file.

3) Delete the last record of the customer table. The delete trigger
should be working again.