Brian,

Generally speaking, an SQL statement that updates "several hundred"
records in one shot would be faster than updating the same records using
native I/O.

IIRC, SQL is generally faster for updating when you get above 100
records.

However, you're dealing with a "series of SQL statements".

If you'd have to replace the series of SQL statements with a series of
native I/O statements, then I'd say stick with the SQL.

If you could replace the series of SQL statements with a single set of
native I/O, you could possibly find the native I/O to be faster.

On the other hand, if you can use a single set of native I/O statements,
you should also be able to use a single SQL statement.  Going back to
the first sentence, the single SQL statement would be your fastest
method.


Are you not happy with the performance as it stands now?

Have you made sure that the appropriate indexes are in place?

HTH,

Charles Wilt
--
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
  

> -----Original Message-----
> From: midrange-l-bounces@xxxxxxxxxxxx 
> [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Brian Piotrowski
> Sent: Friday, May 05, 2006 8:17 AM
> To: Midrange Systems Technical Discussion
> Subject: Stored Procedures vs. SQL Statements vs. CHAIN
> 
> Hi All,
> 
>  
> 
> Can someone tell me in terms of speed which method would be best when
> working with multiple records?  Right now my code uses a series of SQL
> statements to update several hundred records in one shot.  
> I'm thinking
> about moving these statements to a stored procedure instead, but I
> wanted to weigh my choices against a good old CHAIN command as well.
> 
>  
> 
> Anyone have any thoughts or comments?
> 
>  
> 
> Also, can someone please recommend a good Redbook that 
> discusses Stored
> Procedures on the i5?
> 
>  
> 
> Thanks!
> 
>  
> 
> Brian.
> 
>  
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> Brian Piotrowski
> 
> Specialist - I.T.
> 
> Simcoe Parts Service, Inc.
> 
> PH: 705-435-7814
> 
> FX: 705-435-6746
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
>  
> 
> -- 
> This is the Midrange Systems Technical Discussion 
> (MIDRANGE-L) mailing list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.