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



You are right of course.  That was the reason I mentioned  using the cycle
originally.  RPG offers so much power and Unfortunately RPG is often
overlooked in favor of the latest and greatest new fad.  (Not that SQL is a
fad, but the way SQL is used in OS/400 will likely change significantly over
the next few years.
 
 
 
---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@xxxxxxxxxxxx
---------------------------------------------------------
 
-------Original Message-------
 
From: Midrange Systems Technical Discussion
Date: 1/12/2004 6:38:03 PM
To: midrange-l@xxxxxxxxxxxx
Subject: RE: Using SQL to check for duplicate records
 
Booth:
 
The use of the word "key" was unfortunate. It was meant to indicate the
specific positions of the records to check, not necessarily a defined DB2
key. The requirement for SQL, RPG, or probably any other similar useful
technique, must be that the file is ordered on the "key"; i.e., the record
positions used for ordering the file must be the same positions used for
count(*) or lookahead and L1 or... whatever. Rather than "key", perhaps a
phrase such as "sequence field" would be better.
 
There's no necessary relationship between DB2 file keys and lookahead other
than the potential for messing up the duplicates test by presenting records
in the wrong order. For SQL, a GROUP BY makes the order guaranteed; and
GROUP BY is required for count(*) to work for duplicate testing. Lookahead
does not provide ordering as GROUP BY does.
 
To tell the truth, the only reason I mentioned lookahead in the first place
was because of the recent references to the cycle and 'obsolete' features in
RPG400-L. I wasn't even really serious about it. But every rare once in a
while, you see posts like "Gee, I never knew that existed and I needed it
just this week!"
 
Tom Liotta
 
midrange-l-request@xxxxxxxxxxxx wrote:
 
>   2. RE: Using SQL to check for duplicate records (Booth Martin)
>
> The part I missed mostly is that there's no assurance that the fields to
be
>checked are key fields.  In that case the RPG solution won't be of any use.
 
--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertech.com
 
 
__________________________________________________________________
New! Unlimited Netscape Internet Service.
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
Act now to get a personalized email address!
 
Netscape. Just the Net You Need.
_______________________________________________
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-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.