× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



All,

I found the following in the Stored Procedures, triggers, and User
Defined Functions REDBOOK.

"You may want to identify which record image to use, depending on the event that
has activated the trigger. Remember that the system always initializes
the offset fields,
even if one of them may address meaningless data. Table 11-2 shows the
record images
that you actually receive, depending on the event."

Now what exactly does this mean?
1) The offset wouldn't contain invalid data, such as a negative value,
but perhaps zero is ok?
2) The buffer passed to a trigger on a given file, is always the same
size, so there's always room for both images, though the space for one
might contain garbage?


In scenario 2, that would mean I could safely copy a non-existent
image to another area of memory and as long as I don't try to actually
use the column fields.

Actually, as I think about it, I suppose I could do the same even in
scenario 1. Assuming a non-existent image has an offset of zero. I'd
end up copying part of the static buffer, but again, as long as I
didn't then try to access the new buffer as if it really contained a
record image.

Reason I'm asking: I'm trying to use CA Plex to generate a trigger
program. I've got some good reasons for doing so <grin>, but it does
mean there are some limitations. Some of which I wouldn't be an issue
if I wanted to use separate programs to process Inserts, Updates, and
Deletes.

The problem I have is that Plex generates program params as data
structures. During execution, one of the first things it does is a
MOVEL(P) from the parameter DS to another DS where it is actually
used.

C *ENTRY PLIST
C PARM F00059 P00059 7
* TriggerBufferLength
C PARM V00002
* TriggerBufferHeader
C PARM V00004
* OriginalRecord
C PARM V00006
* NewRecord
C PARM V00008
*
C MOVEL (P) V00002 V00001
C MOVEL (P) V00004 V00003
C MOVEL (P) V00006 V00005
C MOVEL (P) V00008 V00007

I can code the program such that columns from V00003, V00005, and
V00007 are not used unless they have valid data. I just need to make
sure that first move isn't going to be a problem.

I can run some tests of course, but I don't think a successful test
today would mean the program will work in the future. I'm hoping to
hear from those in know as to documented behavior as opposed to
coincidental behavior.


Thanks!
Charles Wilt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.