Unanswered: stored procedure to check and update old value to new value of few columns
We extract data using a query from source server 'SERV1' and load the data in one of the table 'T1_data' on target server 'SERV2'. Data for the fields used 'T1_data' may change in the server 'SERV1' after 2-3 days. and we may not be storing the updated values for the columns. 'OPT_ID' column is unique
We found 2 tables 'T1_VAL_Change','T2_VAL_Change' in the source server 'SERV1' which will have the latest updates for the 'OPT_ID''s with columns for
OPT_ID, old_values, New_values, show_field.
We are in need to create a stored procedure, where it checks the 'OPT_ID''s for the past 2 weeks in the target table 'T1_data'. and for the unique 'OPT_ID''s it shud check the source server's 2 tables 'T1_VAL_Change','T2_VAL_Change' for the old and new values using the show_field as filter..since we need only specific column data ex:location,approve, (this will be in the 'T2_VAL_Change.show_field).
I am new to stored procedures and need help or suggestion with the creation.
Thanks in advance
Have you studied all the IBM example stored-procedures ? They are on your DB2 server in the SAMPLES sub-directory, and you can choose which programming-language to use: SQL PL , or JAVA, or 'C' according to whatever language preferences you or your team may have.