Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replaceing a field using another table
Message
De
20/04/2000 23:06:48
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
 
 
À
20/04/2000 22:52:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00362116
Message ID:
00362118
Vues:
20
Try this:

SELECT Policy
SET ORDER TO TAG SSNumber
SCAN FOR EMPTY(Policy.Group_Code)
IF SEEK(Policy.SSNumber,"Client","SSNumber")
REPLACE Group_Code WITH Client.Group_Code IN Policy
ENDIF
SELECT Policy
ENDSCAN

or

SELECT Client
SET ORDER TO TAG SSNumber
SCAN
REPLACE Group_Code WITH Client.Group_Code IN Policy ;
FOR Policy.SSNumber = Client.SSNumber AND EMPTY(Policy.Group_Code)
ENDSCAN

I think that'll work...

>Help,
>
>> I'm trying to update of replace a field in a table, using <
>> another table. The first table has two key fields in it. <
>> The first is client.ss_numb the second is client.Group_code.<
>> The second table's key fields are policy.ssnumber the second<
>> policy.group_code. As you have guessed the reletionship is<
>> between the SSNumber fields. What I'm trying to do is simplly<
>> replace the policy.group_code with client.group_code (char). <
>> Because the policy somtime has more the ten policy records <
>> with the same ssnumber, I need to be able to replace more then<
>> policy.group_code record. The Code I have now works only for two <
>> updates per passes.<
>> My code is as follows: <
>> select policy <
>> set order to tag ssnumber <
>> select distinct ssnumber from policy ;<
>> where empty(group_code) ;<
>> into array a Missing <
>> if type("aMissing[l,l]") = "C" <
>> for ix = 1 to alen(aMissing,l)<
>> if seek(aMissing[ix,l],"client","ssnumber") <
>> lnGroupCode = client.group_code <
>> =seek(aMissing[ix,l],"policy","ssnumber");<
>> replace group_code with lnGroupCode ; <
>>endif<
>>endfor<
>>endif<
>
>>Help John <
Ronald Suen
Epic Information Solutions Inc.
Ph: (780) 488-4418
Fax: (780) 488-0402
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform