create around 800 helper tables with ADF
We have a requirement in our project to create around 800 helper tables in DB2, each with specific columns (row_hash calculation, table_name, primary column, partition column, partition value).
We have tried two approaches so far:
- Using a stored procedure in DB2 with a loop to create the tables dynamically.
Using a DB2-compatible script in ADF lookup with a loop for each activity.
In both approaches, we are facing challenges:
In Approach 1, we are unable to use the loop stored procedure dynamically with only the schema_name as input.
In Approach 2, ADF treats the SQL as a single query or CALL and won’t parse BEGIN..END procedural code unless it’s inside an SP.
Given these issues, we need to:
Dynamically fetch table_name, primary key column, partition column, and partition value in a loop so we don’t have to manually create helper tables.
Input only the schema_name and have the loop/stored procedure create helper tables for all tables in that schema.
Can you please advise how this can be achieved using DB2 and ADF, and what Microsoft-recommended approach or best practice we should follow to meet this requirement? Also, if there are any known limitations or considerations, please share those.
While running the stored procedure RNMOODENG.LOOP_CREATE_HELPERS
in DB2 from ADF (via JDBC), the execution failed with the error:
[SQL0204] TABLES in SYSIBM type *FILE not found
(SQL State: 42704, Vendor Code: -204).
REQUEST NOT TO SEND GPT RESPONSES AS I HAVE PAID VERSION OF GPT 5 :)