Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count probleme
Message
De
02/07/2007 17:44:48
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01237077
Message ID:
01237255
Vues:
13
Hi Bernhart,

right now I am sitting at my local airport waiting for a four hour delayed flight to Madrid, with not too much battery on my laptop....! :-) Anyway, in this case I suggest that you do a count BEFORE every INSERT.
lcMedic='Temesta 2.5'
Select count(*) from CmdMedic where cNom=lcMedic into array aTemp
INSERT INTO CmdMedic ( cNom, nGroupe ) VALUES ( lcMedic, atest+1 )
lcMedic='Aspirine'
Select count(*) from CmdMedic where cNom=lcMedic into array aTemp
INSERT INTO CmdMedic ( cNom, nGroupe ) VALUES ( lcMedic, atest+1 )
.....
>Hi Tore,
>
>Sorry for my poor English...
>
>I want change Value for nGroupe with a Update command ( count() in data )
>
>Example
>
>First record , the Field ngroup must give 1 because it is the first temsta 2,5
>Second record , the field ngroupe must give 1 because it is the first Aspirine
>Third record , the field ngroupe must give 2 because it the second temesta 2,5
>Fourth record , the field ngroupe must give 1 because it the first time Fluimycyl
>
>is not very clear now ?
>
>Thank in advance
>
>bernhart
>
>
>>>Hi all,
>>>
>>>I have a count probleme.
>>>
>>>
>>> CREATE CURSOR CmdMedic ( cNom C(20) , nGroup I )
>>>
>>>
>>>  INSERT INTO CmdMedic ( cNom ) VALUES ( 'Temesta 2.5' )  && I want 1 For ngroup
>>>  INSERT INTO CmdMedic ( cNom ) VALUES ( 'Aspirine' ) && I want 1 For ngroup
>>>  INSERT INTO CmdMedic ( cNom ) VALUES ( 'Temesta 2.5' ) && I want 2 For ngroup
>>>  INSERT INTO CmdMedic ( cNom ) VALUES ( 'Fluimycyl' ) && I want 1 For ngroup
>>>  INSERT INTO CmdMedic ( cNom ) VALUES ( 'Rofenid' )&& I want 1 For ngroup
>>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Temesta 2.5' )&& I want 3 For ngroup
>>>
>>>*-- etc...
>>>
>>>UPDATE ngroup = ???? From CmdMedic
>>>
>>>
>>>How find nGroup with Update Command ?
>>>
>>>Thnak in advance for help.
>>>
>>>
>>>bernhart
>>
>>Your question is not very clear. Is this what you want?
>>INSERT INTO CmdMedic ( cNom , nGroup) VALUES ( 'Aspirine',1 )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform