Filling several tables with dataport

Hello ! I’d like to fill 3 tables with data using a dataport. Unfortunatly the data is related, so it is not possible to fill table 1 complete, after that fill table 2 complete and so on. So, each data row must be inserted in table 1, table 2 and table 3, before the next data row can be processed. How can i achieve this ? thank you in advance Sascha Schmidt

that’s not a difficult task really… just a tricky one :wink: Way of doing: 1) Create a new dataport based on integer 2) On the dataport item integer, set the Autosave property to false. 3) Define a variable of each type (table1,table2 & table3) of tables u’re needing to insert the data in. 4) Set the current import method used (fixed or variable)… fixed it brings usually more controlled imports. 5) Define a variable of appropiate type for each data field of the tables u’re going to import in each row of the file. 6) Define as many dataport fields as data in each row u’ll get, asociating each dataport field to a each of the variables previously created in point 5. 7) On the OnAfterImport method create the code needed for traspassing those values from the variables to the table’s ones, inserting the tables records’ variables (remember initializating the records in your process). 8) compile, save & run. You can create a small sample for testing :wink: Regards, – Alfonso Pertierra Spain

Declare global variables and use them as source expression for the fields that shouldn’t update the tabel in the dataports DataItem. Then You use the values in Your global variables in the OnAfterImport Trigger to update the other tables. //Lars