Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update command
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01210934
Message ID:
01210990
Views:
11
Bonsoir Naomi,

THis Code give me a good result.
LOCAL cValue,;
  lnselect


lnselect = SELECT( 0 )


SELECT Medicnom
SCAN ALL

  cValue = ""
  SELECT TRAITER
  SCAN ALL FOR imedicId = Medicnom.iid

    IF SEEK( TRAITER.iresidentid , "resident" , "primary" ) 
      cValue = cValue + TRAITER.cnomteleph + CR
      WAIT WINDOW Teleph.cnomteleph NOWAIT
         
    ENDIF

  ENDSCAN
  
  
  SELECT Medicnom
  REPLACE gresident WITH cValue

ENDSCAN


SELECT ( lnselect )
It possible with a Update command ?





>>Hi all,
>>
>>I HAVE
>>*-- MEDICNOM.DBF WITH TEMESTA 2.5
>>*-- TRAITER.DBF WITH JEAN - PIERRE - PAUL ( They Have Temesta 2.5 )
>>
>> medicnom.gresident is a memo field
>>
>>I want for Medicnom temesta 2.5 a value for gresident =
>>"JEAN
>>PIERRE
>>PAUL"
>>
>>
>>
>>   UPDATE Me ;
>>    SET gresident= '',;
>>    gresident =;
>>    Tr.cnomteleph + CR ;
>>    FROM Medicnom Me;
>>    JOIN Traiter Tr ON Tr.imedicid = Me.iid ;
>>   WHERE EXISTS (;
>>    SELECT Tcor.imedicid FROM Traiter Tcor )
>>
>>
>
>>Give only a record ( g PAUL and NOT PIERRE OR PAUL )
>>
>>Ps PIERRE PAUL AND JEAN HAVE Temesta 2.5
>>
>>Thank very much for help
>>
>>
>>bernhart
>
>Your request is unclear. All I can say based on the above update, that you don't need to list gResident twice and it looks like WHERE EXISTS does nothing useful.
>
>Can you select records you would want to update into the cursor when just join with this cursor in your update command? This way you would be sure what you're doing.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform