There can be a major problem with the second syntax depending on what you are doing to the file. The SELECT filevar syntax does not create a select list even in memory. It traverses each group in order as you perform the readnext command keeping a pointer to where it left off. This is why is can be so much faster/more efficient than a select to a list which must: a) traverse the file to create the list and b) hold that list somewhere.
The problem comes in if you write back to the file you are traversing. This will reorganize the group moving where records are located. You can end up records not being processed that you believed were going to be. You are much safer either Executing an Retrieve select or selecting to a list. Rich Taylor | Senior Programmer/Analyst| VERTIS 250 W. Pratt Street | Baltimore, MD 21201 P 410.361.8688 | F 410.528.0319 [EMAIL PROTECTED] | http://www.vertisinc.com Vertis is the premier provider of targeted advertising, media, and marketing services that drive consumers to marketers more effectively. "The more they complicate the plumbing the easier it is to stop up the drain" - Montgomery Scott NCC-1701 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:owner-u2- > [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Thursday, July 14, 2005 12:05 AM > To: [email protected] (u2-Users) > Subject: [U2] [UV] Select Question > > Hi all, > > Can someone tell me the diference between the following two examples of > executing an external select? > > SELECT FILE TO LIST > LOOP > READNEXT ID FROM LIST ELSE ID = @AM > UNTIL ID = @AM DO > REPEAT > > SELECT FILE > LOOP > READNEXT ID ELSE ID = @AM > UNTIL ID = @AM DO > REPEAT > > Someone pointed out to me that there is overhead in selecting to a list > that I need not be exposing myself to. Aren't they both kind of reading > from a list somewhere anyways? > > Thanks > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
