Kbase P5292: A FIND statement within WRITE TRIGGER fails to find a newly created Record with error 565
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  09/10/2008 |
|
Status: Verified
SYMPTOM(s):
A FIND statement within WRITE TRIGGER fails to find a newly created record with error 565
** FIND FIRST/LAST failed for table . (565)
FACT(s) (Environment):
Compiling the procedure with XREF option shows a specific compound index is used
Only assigning part of the record fields
CAUSE:
This is expected behavior. If a FIND is executed within a WRITE TRIGGER using the same specific index on the record that has just been created, at this time, this find will fail because only part of the used index has been assigned and the record is not yet released.
UPDATE, SET, and ASSIGN statements do not actually write records to the database. it only store the record values in the buffer.
It is only at the end of a transaction (or at the end of the record scope or AFTER an explicit RELEASE) that modified record are sent to the database.
FIX:
Use one of the following:
1) Use a RELEASE statement directly after the ASSIGN statement or use VALIDATE statement to force the record to be sent to the database.
2) Assign values to ALL fields of the index
3) Use USE-INDEX option with an index that does contain ALL the fields in the assignment.