Global Variables

  • Hi all, i have a question regarding assign a value to Global variable. I defined a Global variable and i want to set the value as max load date of target table.

    To explain more clear

    I have a source called TableA in DB2 data base and i have target table called TableB in Oracle. And i am using DTS package to transfer data.

    Table A

    Col1Varchar2(10)

    Col2Dat2

    Col3Clob

    Here is my target

    TableB

    Col1Varchar2(10)

    Col2Dat2

    Col3Clob

    Now while running the DTS package the global variable should capture max(col2) from TableB and load data greater than last run date.

    Can someone tell me how to do this scenario? I am trying to do this

    Declare

    @start_date date;

    select @start_date = select max(col2) from TableB;

    SELECT col1,clo2,clo3 FROM TableA WHERE col2 > @start_Date

    When I parse the SQL it was successful. But in the transformations tab, I did not find my source columns.

    Then I tried this

    SELECT col1,clo2,clo3 FROM TableA WHERE col2 > ?

    Then I mapped the parameter to Global variable date1. That did not work because of the following error. STRING DATA RIGHT TRUNCATION.

    I really appreciate your help and comments.

    Thanks

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply