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



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charles Wilt wrote:
All,

If I've got a SQL trigger, the system takes care of making sure the
trigger code runs under the same transaction level as the code calling
it.

If I've got a RPGLE trigger, I can check the value "Commit Lock Level"
field in the trigger buffer and USROPN any additional files under
commitment control as needed.

BUT, what if I've got an SQLRPGLE program that uses embedded SQL to
write to other files; can I check the "Commit Lock Level" and run the
appropriate SET TRANSACTION statement? Is there a better way?

Thanks!
Charles Wilt

My notes on this say: "If embedded SQL is used to update ancillary
tables in this trigger, compile the program with the COMMIT(*NONE)
option. SQL will then adopt the commitment behavior of the job or
activation level. See the DB2 UDB for AS/400 SQL reference subsection
titled 'Notes' in the section covering 'COMMIT' for an explanation of
exactly how this works."

I've been using a trigger template to build RPGLE triggers since
(apparently) 1998, and have had no issues. The commit level is inherited
from the caller. I vaguely remember that SET, COMMIT and ROLLBACK cannot
be used in an RPGLE trigger program. COMMIT needs to happen in the
application code, not the trigger.

hth

- --
Pete Hall
pete@xxxxxxxxxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkuYNeAACgkQXczQcKdXKg4M9QCgu9wN049E211PWPo4pXIT6ZKE
XWkAoL3yjEhsa5T2298IrPEZMDz7GhIh
=iFW/
-----END PGP SIGNATURE-----

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.