This topic contains 2 replies, has 2 voices, and was last updated by Eliot Muir 8 years, 1 month ago.
LUA: writing to 2 DB tables, 1 row to 1 and mutiple rows to 2
You must be logged in to reply to this topic.
This topic contains 2 replies, has 2 voices, and was last updated by Eliot Muir 8 years, 1 month ago.
Is there a way to write 1 row to 1 table and 2 (or more) rows to another using the same VMD which has both tables defined in it. The 2nd table takes multiple rows corresponding to the single row in the first table.
_______________________
Please, disregard. I was able to do this by making 2 separate message segments in the VMD file and employing a LUA WHILE loop.
Tricky to answer without more information.
I would say yes.
But it’s probably not the entire answer you are looking for?
There is a lot of flexibility with what you can do. For instance if the 2nd table has column names which match the first table you can write a loop to go through a row in first table and copy it into another table. There are methods like nodeValue() and nodeName() and using the # operator to get the count of children (i.e. columns in a table row).
Are you wondering about setting up primary key relationships?
You must be logged in to reply to this topic.