Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update Sql Command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01202518
Message ID:
01202613
Vues:
14
What version of VFP?
You could do this with one command in VFP9.


>>
>>I'm not sure what exactly do you want to do. Do you want to update all nStkJour field with the value from the previous date?
>
>Yes , you understood with my poor english ...:)
>
>>SELECT nvl(apcor.nstkjour,tcor.nStkJour) as nStkJour, apCor.nID ;
>>FROM AgendaPhar apcor ;
>> INNER JOIN Traiter Tcor ON Tcor.iid = apcor.itraiterId ;
>>WHERE apcor.ddate < vp_date into cursor curChanges
>>
>>update AgendaPhar set nStkJour =curChanges.nStkJour ;
>>from AgendaPhar inner join curChanges on ;
>>AgendaPhar.nID = curChanges.nID
>
>
>Ok naomi , that good !
>2 Commands are necessary ?
>
>A big thank...
>
>
>bernhart
>
>
>>
>>
>>>
>>>>>Thank Sergey.
>>>>>
>>>>>I have a another problem with a another sql command.
>>>>>
>>>>>
>>>>> vp_date = DATE()
>>>>>* I want the stock From yesterday
>>>>>*-- If not exist in agendaPhar i get the stock from Traiter.dbf
>>>>>
>>>>>UPDATE AgendaPhar ;
>>>>>      SET ;
>>>>>      NVL( nstkjour = (  SELECT  apcor.nstkjour FROM AgendaPhar apcor ;
>>>>>      INNER JOIN Traiter Tcor ON Tcor.iid = apcor.itraiterId WHERE apcor.ddate < vp_date ) , 0 )
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>This command give me a error when i try to save the programm.
>>>>>Invalid use of a visual foxpro function...
>>>>>
>>>>>A idea ?
>>>>>A very big thank for your help.
>>>>>
>>>>Bernhart,
>>>>
>>>>In update command you can not use NVL for the field you're updating. In other words, it should be
>>>>
>>>>Update MyTable Set MyField = ....
>>>>
>>>>Move NVL to the proper place in the command.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform