Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending record in table when key changes
Message
 
À
18/11/2005 06:11:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01070099
Message ID:
01070120
Vues:
26
>>>I have about 1000 records in a table ordered by the mainkey field. i.e.
>>>
>>>
>>>Mainkey
>>>---------
>>>Neil01    Cutting
>>>Neil02    Costing
>>>Neil02    Made
>>>Neil02    Sent
>>>
>>>
>>>everytime the mainkey changes when I scan down the table I want to append a record in another table with the value of mainkey.
>>>
>>>How can i do this easily??
>>
>>SELECT YourTable
>>lc_Mainkey = YourTable.Mainkey
>>SCAN
>>    IF lc_Mainkey # YourTable.Mainkey
>>       INSERT INTO othertable ....
>>       lc_Mainkey = YourTable.Mainkey
>>    ENDIF
>>    ...
>>ENDSCAN
>>
>
>Vlad,
>A small correction:
>
>lc_Mainkey = ''
>SCAN
>    IF !(m.lc_Mainkey == YourTable.Mainkey)
>
Cetin

I agree with the correction.
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform