I guess when I originally read his post I thought maybe he was confused as 
to what it was doing.  But upon rereading it I guess it could be he just 
didn't understand why the programmer coded it that way, in light of the 
discussion that was ongoing at the time.
"Not to dismiss however 
that the use of SQL for INSERT may have allowed for more efficiency in a 
coding task, esp. had the RLA update logic already existed."
I don't really understand what you're saying here.... Not sure what coding 
efficiency you could be referring to...
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
CRPence <CRPbottle@xxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/27/2011 11:11 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
rpg400-l@xxxxxxxxxxxx
cc
Subject
Re: insert code  was(Re: Embedded SQL - performance question)
On 27-May-2011 06:15 , Bryce Martin wrote:
It was basically a way of doing something like the following.... in
pseudo code....
chain (pattern1: color1:) myfile
if found
   update
else
   write
endif
instead he did this.....
write
if error
   update
endif
   That interpretation obscures the effects of the original coding, 
whereby the file effectively had been declared twice in the program. 
There would have been two ODPs to perform as originally written, one 
Open Data Path used for insert\write, and the other ODP used for the 
update.  In either scenario coded above, the logic could be satisfied 
with just one native\RLA OPEN for update; i.e. more efficiently than 
having used both the SQL INSERT and RLA update.  Not to dismiss however 
that the use of SQL for INSERT may have allowed for more efficiency in a 
coding task, esp. had the RLA update logic already existed.
Regards, Chuck
 
As an Amazon Associate we earn from qualifying purchases.