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