August 27, 2009 at 8:19 am
Hi All, i am trying to do following scenario to fetch the latest data when i execute the DTS package
Source is DB2 and target is Oracle
First i defined execute SQL task and fetching the max(load_date) from target table and store it in a variable called date1.
select max(load_date) into date1 from target_table.
Now in my Transform Data task properties i am using that variable on Source Query like this..
select * from source_table where lod_date > date1
But when i execute the DTS package, it ran successfully without any errors. Then i figured it, the variable i defined is local to that execute SQL task.
Now, i defined a Global variable and i am trying to assign the same values that come from the following query.
select max(load_date) into date1 from target_table.
like this
dim max_date
set DTSGlobalVariables("date1").Value = max_date
set max_date = 'select max(load_date) into date1 from target_table'
Main = DTSTaskExecResults_Success
EndFunction.
But my problem is i am getting systax error while set the max_date value through the SQL.
It would be great if someone can help to resolve this issue?
Thanks in Advance
Thanks
August 28, 2009 at 11:26 am
Hi all, i resoveld this issue..I did following steps
i wrote a select statement in my execute SQL task to select the max date
and assign that to output variable.
And i called that output variable in data transform Task.
I thought this might be helpful if someone read this post.
Thanks a lot everyone..
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply