Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using UPDATE for Memo field
Message
De
08/08/2004 04:52:23
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00931478
Message ID:
00931606
Vues:
33

Thank you very much for the suggestion.

I am sure what you are suggesting makes sense and will work. But I just don't get something. I don't understand what you mean by "fields list length is fixed.". Also I am trying to apply your suggestion to an example of inserting two fields, one character type, another numeric.


"fields list length is fixed." : the number of fields into the INSERT is constant,
that is it is always the same number.


For example. Say the table RR_RESER has two fields NUM_FLD N(10), and CHAR_FLD C(100). Then I am trying to insert values 100, "My String". I think the value of cFieldName would be:

cFieldName = "NUM_FLD, CHAR_FLD"

But I can't figure out how to combine values 100 and "My String" into the variable m.cFieldValues.

What am I missing? Thank you.


You cannot use single a variable for combine two or more fields, every variable it indicates a single field whose name can change.
INSERT INTO (m.tablename) (m.cFieldName1,m.cFieldName2...)
Of course, if the number of fields can change, you have to use a Macro or another way.

If you use variables with name equal to field Name, then:
cFieldNames = "NUM_FLD, CHAR_FLD"
cFieldValues = "m.NUM_FLD, m.CHAR_FLD"
insertcommand="INSERT INTO "+m.TableName+" ("+m.cFieldNames+")VALUES("+m.FieldValues+")"
But this is equal to :
INSERT INTO (m.TableName) FROM MEMVAR
An other simple solution is that one to use an object with the values puttinges in its property with the name of the property equal to the name of every corresponding field,
then the INSERT is a direct command:
INSERT INTO (m.TableName) FROM NAME m.oFieldValuesToInsert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform