Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ducepair
Starting Member
7 Posts |
Posted - 2009-08-24 : 18:11:27
|
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 clearI 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 ACol1 Varchar2(10)Col2 Dat2Col3 ClobHere is my target TableBCol1 Varchar2(10)Col2 Dat2Col3 ClobNow 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 thisDeclare @start_date date;select @start_date = select max(col2) from TableB;SELECT col1,clo2,clo3 FROM TableA WHERE col2 > @start_DateWhen I parse the SQL it was successful. But in the transformations tab, I did not find my source columns.Then I tried thisSELECT 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 |
|
|
|
|