Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2014

    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

  2. #2
    Join Date
    Apr 2012
    Provided Answers: 17
    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.

  3. #3
    Join Date
    Dec 2007
    Richmond, VA
    Provided Answers: 5
    have you considered Q-rep or similar? Might be a bit easier for you to maintain.

  4. #4
    Join Date
    Mar 2014
    We are advised to write this in SQL PL..

    I have gone through some of the examples. though I was looking for some examples related to our requirement.

    any links or docs related will be helpful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts