|
Could you use a prepared SQL statement? Then just pass in the file name into the program, build the sql statement and execute it. No need to worry the file, nice and generic.
_____
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Crispin Bates
Sent: Friday, September 19, 2008 3:05 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Need generic routine to invoke trigger program,using C
language _Rread perhaps?
Charles,
Could you just add the trigger as a *READ trigger for the "re-build" and
then have a generic RPG program that defines the file as program described,
ovrdbf lvlchk(*no) and just read through the file until the end?
Crispin.
----- Original Message -----
From: "Charles Wilt" <charles.wilt@xxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, September 19, 2008 2:30 PM
Subject: Re: Need generic routine to invoke trigger program,using C language
_Rread perhaps?
On Fri, Sep 19, 2008 at 1:54 PM, Crispin Bates <cbates@xxxxxxxxxxx> wrote:--
Charles,
It's part of 2E 8.1.
Oh, well we're still on 8.0 I believe....
I'm not sure why the lack of a 2E runtime would preclude using a solution
that is already available to you (assuming you have at least a relatively
current release of the product). You're going to have to install
something.
I dugress...
I don't know how 2E is licensed, but I suppose there might be no limit
to how many machines you can install the runtime on.
But it doesn't sound like you want to implement a trigger handler, but
rather something that will read all records for any file and call the
trigger for each of those records.
Correct.
Did someone forget to add the triggers to the production data :-)
No. The triggers are part of a process that keeps an Oracle DB sync'd
with the iSeries; or rather it's supposed to keep it in sync. For
various reasons, sometimes it gets out of sync, thus we need to reload
all the records in the oracle DB. The current process (which I've
inherited ;-) was designed around a rebuild program specific to each
table that contained the SQL update statement I mentioned before.
Originally, it was dog slow. I'm made some improvements, now it runs
in 1/3 to 1/2 the time as before. But still not speedy. My thinking
is that if I can get rid of the "dummy" update being done and simply
invoke the trigger, I'd be much better off.
I'd like to do it generically, that way I have only one new program to
write, plus that way if we add tables in the future, I don't have to
write a table specific rebuild program.
Charles
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.