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



So why use SQL to insert and the native IO for update?
Why not use SQL update?
I think that is the OP's drift?

Paul Therrien
Andeco Software, LLC
932 Saint Johns Dr
Maryville, TN 37801
225-229-2491
paultherrien@xxxxxxxxxxxxxxxxxx
www.andecosoftware.com

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Gqcy
Sent: Thursday, May 26, 2011 6:01 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: insert code was(Re: Embedded SQL - performance question)

SQL code -803
"violation of constraint..."

I would suspect there is a unique key constraint on the file.



On 5/26/2011 4:46 PM, Elbert Cook wrote:
Sorry off topic.

I saw this piece of code on our system yesterday. I'm still not sure what
to
think.

Exec Sql Insert Into myLib/myFile (Pattern, Color, Onhand)
VALUES(:Pattern1,
:Color1, :Qty1);

IF SQLCOD = -803;
Chain (Pattern1: Color1) myFile;
IF %found;
Onhand = Qty1;
Update myFilef %fields(Onhand);
Endif;
Endif;


-----Original Message-----
From: Joe Pluta [mailto:joepluta@xxxxxxxxxxxxxxxxx]
Sent: Thursday, May 26, 2011 5:13 PM
To: RPG programming on the IBM i / System i
Subject: Re: Embedded SQL - performance question

On 5/26/2011 3:16 PM, CRPence wrote:

I expect that SQL should be much faster even on a poorly performing
system; almost as fast as the RLA, esp. if the same index is utilized
for both the SQL and RLA.

I've never found a single-record fetch to be anywhere near as fast as
RLA, and I did exhaustive tests; SQL doesn't catch up until the block
size is upped to about 100 records. I could rerun all those tests, but
until someone shows me some evidence SQL has caught up, I have no reason
to repudiate the old data.

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.