Page 1 of 1

Delta Data from DB2 Stage

Posted: Fri Jul 30, 2010 7:57 am
by DSFreddie
Hi All,

I have a scenario where I need to extract the data from a Mainframe DB2 table(Table A) based on the condition given below.

I have another table from where I need to take max(date)----Select max(date) from table B.

Now, i need to pull the data from Table A based on the condition
A.(Date) > max(B.date)

Pls note that one table is in Mainframe DB2 & the other one is in DB2.

Thanks for your help.
Freddie.

Posted: Fri Jul 30, 2010 8:24 am
by anbu
Create a job to get maximum date from Table B and unload it to a file.

Read maximum date from this file and pass it as a parameter to your second job extracting data from Table A

Posted: Fri Jul 30, 2010 9:14 am
by DSFreddie
Thanks for your reply Anbu.

Is there any way to accomplish this in a single job?

Pls let me know whether are any alternate ways of doing this as I do not want to create 2 jobs for this.

Thanks,
Freddie

Posted: Fri Jul 30, 2010 9:20 am
by ArndW
You cannot do this directly in one job using DB2 stages. It is better to have a sequence which calls first one job to get the max value, then passes that value to the second job which then performs the SQL.