Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql UPDATE() IMPOSSIBILITY
Message
De
09/12/2019 20:54:29
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01672198
Message ID:
01672211
Vues:
61
>In this case use
>
>FROM curNaw INNER JOIN Naw on curNaw.Id = NAW.Id
>
>and don't use WHERE condition (assuming ID is the PK in both tables and you want to update related info)
>
>>>If these two values are constants, just use them directly in your update (no need to use FROM CLAUSE at all). Or simply use replace command.
>>Naomi,
>>No they are not constants, ID is the PUK
>>Would have been a nice solution, but as said, the coding works in a .prg not in a method.
>>And obviously, for clearity here I have only listed two fields, in my .pjx it are around 45 fields.
>>Rgds,
>>Koen
>>
>>>
>>>>Hi,
>>>>
>>>>I have following code in myForm.Updating method:
>>>>
>>>>Select curNAW
>>>>liID = Id
>>>>Update NAW ;
>>>>    SET  ;
>>>>    NAW.Voornaam = curNAW.Voornaam  , ;
>>>>    NAW.geslacht = curNAW.geslacht ;
>>>>    FROM  curNAW ;
>>>>    where NAW.Id  = m.liID
>>>>m.llSuccess = Tableupdate(.F.,.T.)
>>>>
>>>>
>>>>curNAW.Voornaam value = "Koen"
>>>>m.liID =149
>>>>there exsists a NAW.ID = 149
>>>>nevertheless after this update, NAW.Voornaam = [ ]
>>>>
>>>>now when I copy this command to a testsql.prg and run that, it works as it should.
>>>>I am overasked where to look to correct my method, any idea's?
>>>>
>>>>Regards,
>>>>Koen
Naomi,
well I am afraid I dont understand, look here, the function works 100% correct when I run it as a .prg file, when I run it as a method not.
I tried your alternative which given me same effect as my function, in a .prg OK in a method on a form not OK, appiied also the third parameter as proposed by Dragan and Jeff and still no difference.
Now after 2hours+ I decided to use the backup of 2 days earlier: prolem gone! Now have to implent those changes slowly which I made in the last 2 days, untill it does not work anymore (Oh no)
Thanks for support.
Koen
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform