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



That looks great. So, no declaring, opening and closing cursors? That is
pretty neat.

cheers,

Jake.

On 9/20/06, rob@xxxxxxxxx <rob@xxxxxxxxx> wrote:

Great points.

One "point of information" though.  It's not
/Exec Sql Select ItemNumber, ItemDescription From ItemFile Where
ItemNumber = :Item;
It's
Exec Sql Select ItemNumber, ItemDescription From ItemFile Where
ItemNumber = :Item;

No slash.

Actually it's
Exec Sql Select ItemDescription into :ItemDescription From ItemFile Where
ItemNumber = :Item;
After all, if you already know the item number, why move those bytes
around again?  And, on a cursorless select you need the into.  But that's
just details.  Your points are well taken.

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Alan Campin" <Alan.Campin@xxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
09/20/2006 01:49 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
<rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: Simple Display file problem






<snip>
Thanks for that insight. Can SQL be used in free-form in V5R4 without
the
use of /EXEC and and /END-EXEC tags in C specs? Or do we still have to
use
/EXEC and /END-EXEC but can get rid of the C specs. We are still on V5R3
and
will take some time to get there but such things are really good to
know.
</snip>

New syntax is

/Exec Sql Select ItemNumber, ItemDescription From ItemFile Where
ItemNumber = :Item;

No /End-Exec. Just a semi-colon.

Asked my boss to get V5R4 on order.

<snip>
Yes IBM did give us an easy way create an LF & include only the fields
you need...
</snip>

Except the catch. It works and increases performance a lot but if I need
to bring in five tables into a program, I am going to have to define 5
different logical views unless I can do some joins. Even having a tool
to do this, a lot of work and difficult to maintain. I have built system
using the techniques but a ton of work.

<snip>
all true Alan. But does a 600 CPW i5 have the horsepower to run pure
SQL instead of RPG?  My guess is it does not.  Fetching thru an SQL
cursor must be slower than setll and reade. The mapping of more than a
few SELECT columns would quickly become more cpu intensive than a byte
copy into a record format.
</snip>

Actually the opposite is true.

1. New SQL I/O system is 5 to 7 times faster than DDS file.

2. New SQL Index system is 2 to 3 times faster than DDS indexes.

3. SQL has a new query optimizer that is a lot more efficient.

4. Reading in only the data you need is always going to be faster than
reading the entire record. A lot of reasons for this primarily having to
do with buffers. IBM optimizes the moves but byte moves are just not
going to be significant. Record I/O is the most expensive thing in the
system.

5. The other thing with SQL is that you can read multiple records into
an array mapped to a user space. You cannot do that with Record I/O. If
you are reading multiple tables with selects and reading in multiple
records into a user space, the performance is going to be way faster.
All the work is going to happen at the machine level. I gave an example
in a previous post.

In short, what used to be true is just not true anymore and it is only
going to get better. SQL is present and the future.

The only reason I see to continue a lot of record I/O is severely
unnormalized databases.

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


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

Follow-Ups:
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.