× 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.



Hi Chuck,

I hope you're not feeling picked on here! I'm still having a hard time understanding your objection and some of your explanations.

CRPence wrote:
No. Insert Trigger act between the trigger program and the database; they have their own contractual obligations. A Read Trigger is between the HLL and the database. That is what makes them totally different.
What does this mean? From the app pgm point of view, all of these triggers -- READ, INSERT, UPDATE, DELETE -- are between it and the database.

I have obviously not been articulating well, the flaws in a change capable trigger, since all that comes from it is the repeated argument that "anything can mess with the data, so a Read Trigger should be able to as well." So maybe a theoretical example, assuming the added Read Trigger is change capable:

create table qgpl. T (i int, c char)
addpftrg qgpl/T *after *read pgm(plusone)
-- plusone returns a value one greater than in field i
insert into table qgpl.T values(1, DEFAULT)
call read4upd /* open T for upd, read, upd C='', close */
-- trigger program is called, set i = 2 as /desired/
-- Does the row update to the value 2 or stay 1 ?
-- Well, to pass the row with that value to the program,
-- the buffer was just updated to have the value 2
-- So the program updates without changing the value i,
-- yet the value in the table for i is now 2

The same table now, with the value 2:

select i from qgpl.T where i <= 2 into :ii

The fetched value ii does not meet the selection logic; i.e. ii=3 whereas all coded logic is with respect to selecting only values that were /less than or equal to two/. Where is the logic in that? This is much worse for /native/ programs, where logic is more likely to be deferred to the application and HLL run-time.

What if you turned your example around? Put an update trigger on a file. Have it always add 1 to i. Now what? App pgm reads the file, adds 1 to i, updates the record. If i started out as 1, it is now 3. Where's the logic in that?

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.