Hi,
I have a table with the following sample data.
Table 1:
S.No Table_Name Condition_Clause
1 xyz emp_id = 3
2 ABC Sal > 10000
3 KLM Age < 35
I've to write a DB2 procedure with "S.No" field as input and based on the input, it should select the "Table_Name" and the "Condition_Clause". I need to create a dynamic cursor using the "Table_Name" and "Condition_Clause" in the cursor definition "Select" statement and fetch the records from the cursor and process those records and insert new record in to some other table.
Is this scenario possible in DB2 Dynamic Cursors? For me it gives error for the dynamic cursor declaration. Can anyone help me on this with a sample code?
Thanks,
Kayal.