Load different tables into one single mapping table (mapping concatenate load)
I have 4 different database tables that contain supplier numbers with each time a different notion.
Table 1 : contains test supplier numbers
Table 2 : contains intercompany suppliers
Table 3 : contains interbranch suppliers
Table 4 : contains all suppliers (including the ones from table 1/2/3)
I would like to create a mapping table (map_supplier) with 2 fields :
=> map_supplier_number
=> map_supplier_type
For table 1-3 I want to load the data where supplier number = the number in the table and supplier type = 'TEST'(for table 1) / 'INTERCOMPANY' (for table 2) / 'INTERBRANCH' (for table 3)
Finally, when I upload table 4, I want to use the function applymap('map_supplier', supplier_number, 'OTHER'). This way, all suppliers are either categorized as according to the mapping table and if not found in the mapping table, they have supplier_type = 'OTHER'.
The problem is that you cannot use the keyword CONCATENATE together with MAPPING.
Is there another solution ? All suppliers should have a supplier type, that's why I would like to use the mapping function.