Jeff Kendrick
2004-05-12 18:38:44 UTC
I've got an issue that has me stumped. Any help or insights would be greatly
appreciated.
I have created a file specifically for reporting purposes. This reporting file
is maintained EXCLUSIVELY via a Unidata TRIGGER subroutine on a primary
application file. The reporting file is also indexed on a couple of fields.
I've written the trigger subroutine to perform the update to the reporting
file, and used CREATE.TRIGGER to establish it as an update trigger for the
primary file. The trigger subroutine is properly handling adds and updates to
the primary file. (Deletes will be next, but I haven't gotten there yet --
nor will I if I can't understand what's going on.)
What's happening is that while the reporting file is being properly updated,
the indices are not being updated AT ALL. This is confirmed by looking at the
Unix level -- the timestamp on the file is far behind the timestamp on the
actual data file. This is happening even though LIST.INDEX shows that indices
are enabled.
Now, if I use AE to update the reporting file DIRECTLY, then the indices are
updated for the one record that is modified. This proves that the indices are
created and enabled. -- but no updates via my trigger subroutine.
Finally, if I run a BUILD.INDEX on the reporting file, all of the indices are
built and all is well, but that solution is not acceptable. The whole point is
to avoid any and all maintenance on the reporting file, while maintaining its
synchronization with the primary file. ("Set it, and forget it," to borrow
a phrase.)
Has anyone had a similar experience with Unidata indices and triggers? If so,
can you help me to understand what is wrong with my setup?
Again, any help would be greatly appreciated.
Jeff
appreciated.
I have created a file specifically for reporting purposes. This reporting file
is maintained EXCLUSIVELY via a Unidata TRIGGER subroutine on a primary
application file. The reporting file is also indexed on a couple of fields.
I've written the trigger subroutine to perform the update to the reporting
file, and used CREATE.TRIGGER to establish it as an update trigger for the
primary file. The trigger subroutine is properly handling adds and updates to
the primary file. (Deletes will be next, but I haven't gotten there yet --
nor will I if I can't understand what's going on.)
What's happening is that while the reporting file is being properly updated,
the indices are not being updated AT ALL. This is confirmed by looking at the
Unix level -- the timestamp on the file is far behind the timestamp on the
actual data file. This is happening even though LIST.INDEX shows that indices
are enabled.
Now, if I use AE to update the reporting file DIRECTLY, then the indices are
updated for the one record that is modified. This proves that the indices are
created and enabled. -- but no updates via my trigger subroutine.
Finally, if I run a BUILD.INDEX on the reporting file, all of the indices are
built and all is well, but that solution is not acceptable. The whole point is
to avoid any and all maintenance on the reporting file, while maintaining its
synchronization with the primary file. ("Set it, and forget it," to borrow
a phrase.)
Has anyone had a similar experience with Unidata indices and triggers? If so,
can you help me to understand what is wrong with my setup?
Again, any help would be greatly appreciated.
Jeff