Hai All…
I have a table containg column name and value of another table, which is to be inserted.
How can I Insert without specifying each field = it’s value. Any thing like dynamic query in SQL.
Can anyone help me about this problem?
Thanks.
Hai All…
I have a table containg column name and value of another table, which is to be inserted.
How can I Insert without specifying each field = it’s value. Any thing like dynamic query in SQL.
Can anyone help me about this problem?
Thanks.
This should help you: http://www.doens.be/2009/07/select-a-record-from-a-table-when-you-only-have-the-tableid/
It shows how to update an existing record, but you can also create a new record, using “common = dictTable.makeRecord();”
You can fill the field values, because you have the fieldnames. “fieldId = fieldname2id(_tableId,_field);” will get you the correct fieldId to set the value (see example in link).
You just have to call “common.insert();” after you have filled all the fields, and preferably do a validateWrite() before inserting.
This is what I was excatly looking for.
Thank you very much Mr.Bjorn…