Integration

Get Involved. Join the Conversation.

Topic

    Abhinav Kumar
    Integration
    Topic posted September 28, 2019 by Abhinav KumarRed Ribbon: 250+ Points, tagged Database, Integration 
    59 Views, 3 Comments
    Title:
    Integration
    Content:

    I have to update the a staging table with the values from the input file. I  have to run the following query in AIC.

    UPDATE staging_table
        SET active_flag = :active_flag
           ,last_update_date = SYSDATE
           ,last_updated_by = :user_name
      WHERE target_value1 = :target_value1
        AND NVL(active_flag,'Y') <> :active_flag
        AND NVL(target_segment1, 'DEFAULT') = NVL(:x_segment1, 'DEFAULT')
        AND NVL(target_segment2, 'DEFAULT') = NVL(:x_segment2, 'DEFAULT')
        AND NVL(target_segment3, 'DEFAULT') = NVL(:x_segment3, 'DEFAULT')
        AND NVL(target_segment4, 'DEFAULT') = NVL(:x_segment4, 'DEFAULT')
        AND NVL(target_segment5, 'DEFAULT') = NVL(:x_segment5, 'DEFAULT')
        AND NVL(target_segment6, 'DEFAULT') = NVL(:x_segment6, 'DEFAULT')
        AND NVL(target_segment7, 'DEFAULT') = NVL(:x_segment7, 'DEFAULT')
        AND NVL(target_segment8, 'DEFAULT') = NVL(:x_segment8, 'DEFAULT')
        AND NVL(target_segment9, 'DEFAULT') = NVL(:x_segment9, 'DEFAULT')
        AND NVL(target_segment10, 'DEFAULT') = NVL(:x_segment10, 'DEFAULT')
        AND NVL(target_segment11, 'DEFAULT') = NVL(:x_segment11, 'DEFAULT')
        AND NVL(target_segment12, 'DEFAULT') = NVL(:x_segment12, 'DEFAULT')

    I am using a DB adapter in the AIC, to run this query and giving this query in AIC.

    UPDATE staging_table
        SET active_flag = #active_flag
           ,last_update_date = SYSDATE
           ,last_updated_by = #user_name
      WHERE target_value1 = #target_value1
        AND NVL(active_flag,'Y') <> #active_flag
        AND NVL(target_segment1, 'DEFAULT') = NVL(:x_segment1, 'DEFAULT')
        AND NVL(target_segment2, 'DEFAULT') = NVL(:x_segment2, 'DEFAULT')
        AND NVL(target_segment3, 'DEFAULT') = NVL(:x_segment3, 'DEFAULT')
        AND NVL(target_segment4, 'DEFAULT') = NVL(:x_segment4, 'DEFAULT')
        AND NVL(target_segment5, 'DEFAULT') = NVL(:x_segment5, 'DEFAULT')
        AND NVL(target_segment6, 'DEFAULT') = NVL(:x_segment6, 'DEFAULT')
        AND NVL(target_segment7, 'DEFAULT') = NVL(:x_segment7, 'DEFAULT')
        AND NVL(target_segment8, 'DEFAULT') = NVL(:x_segment8, 'DEFAULT')
        AND NVL(target_segment9, 'DEFAULT') = NVL(:x_segment9, 'DEFAULT')
        AND NVL(target_segment10, 'DEFAULT') = NVL(:x_segment10, 'DEFAULT')
        AND NVL(target_segment11, 'DEFAULT') = NVL(:x_segment11, 'DEFAULT')
        AND NVL(target_segment12, 'DEFAULT') = NVL(:x_segment12, 'DEFAULT')

     

    But I am getting error while running.

    Comment