Dynamic SQL query based on Table Mapping

I want to create a dynamics sql query in X++.

For Example, i have 2 Tables. 1) AX Staging and 2 ) AX Transaction

My objective is to import All the transaction from AX transaction to AX Staging table

I don’t want to use sql Query like

while select axTransaction




axstaging.Field = axTransaction.Field;



I dont want to use above x++ sql.

I need SQL statment should be dynamic, In that case I will be using one more table AXMapping

where I will have AXStagingTableId, AXTransactionTableId, AXStagingFieldId, AXTransactionField.;

How can u utilize this process similar to DIXF. Here only difference is AXTransaction Table should behave like Excel sheet.