Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan....EndScan
Message
De
10/02/2004 05:07:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/02/2004 13:00:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00875534
Message ID:
00875811
Vues:
15
This message has been marked as a message which has helped to the initial question of the thread.
>Can someone explain what should be happening and the best recommendation on handling this process better. I am scanning a table with 7 plus million records. I would like to decipher only records that begin with particular NSN's and insert those tables into my prod table. Code is listed as:
>
>************
>sele fed_temp
>scan for SUBSTR(NSN,1,2) = '23' ;
>.or. SUBSTR(NSN,1,2) = '24' .or. SUBSTR(NSN,1,2) = '25' ;
>.or. SUBSTR(NSN,1,2) = '26';
>.or. SUBSTR(NSN,1,2) = '28' ;
>.or. SUBSTR(NSN,1,2) = '29' .or. SUBSTR(NSN,1,2) = '30' ;
>.or. SUBSTR(NSN,1,2) = '31' .or. SUBSTR(NSN,1,2) = '39' ;
>.or. SUBSTR(NSN,1,2) = '40' .or. SUBSTR(NSN,1,2) = '41' ;
>.or. SUBSTR(NSN,1,2) = '42' .or. SUBSTR(NSN,1,2) = '49' ;
>.or. SUBSTR(NSN,1,2) = '51' .or. SUBSTR(NSN,1,2) = '52' ;
>.or. SUBSTR(NSN,1,2) = '53' .or. SUBSTR(NSN,1,2) = '58' ;
>.or. SUBSTR(NSN,1,2) = '59' .or. SUBSTR(NSN,1,2) = '62' ;
>.or. SUBSTR(NSN,1,2) = '60' .or. SUBSTR(NSN,1,2) = '61' ;
>.or. SUBSTR(NSN,1,2) = '63' .or. SUBSTR(NSN,1,2) = '67' ;
>.or. SUBSTR(NSN,1,2) = '68' .or. SUBSTR(NSN,1,2) = '69' ;
>.or. SUBSTR(NSN,1,2) = '70' .or. SUBSTR(NSN,1,2) = '72' ;
>.or. SUBSTR(NSN,1,2) = '71' .or. SUBSTR(NSN,1,2) = '73'
>
>scatter memvar
>
>sele prod_table
>insert into prod_table from memvar memo
>
>sele fed_temp
>
>endscan
>
>Can anyone: 1.) explain what exactly the record pointer is doing by doing the scan this way
>
>2.) Recommend a better way to cipher through 7 million records and get only the 1 or 2 million that i want....

Jeffrey,
Thinking you might have an index on nsn it might be better to use xbase with = operator :
Local lcNumbers, lnGroups,ix
Local array aStruc[1]
lcNumbers = '23,24,25,26,28,29,30,31,39,40,41,42,49,51,'+;
            '52,53,58,59,62,60,61,63,67,68,69,70,72,71,73'
lnGroups = ALines(aSet,m.lcNumbers,.t.,',')

Set Exact Off
Select fed_temp
AFields(aStruc)
Create Table prodTable from array aStruc
For ix=1 to lnGroups
   Append From fed_temp for nsn = aSet[m.ix]
endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform