Page 1 of 1

LEFT OUTER JOINS

Posted: Fri Oct 22, 2004 7:23 am
by rcasey
Greetings. I need to do a left outer join in DB2 API and use a between date range, example;;
key1 = key2 and date1 between date 2 and date3. I keyed the join into the api stage and it worked in the viewer but the osh abends when I attempt to run it. I then attempted the join stage but do not seem to be able to put in the logic for the between condition. Any ideas?
THX

Posted: Thu Oct 28, 2004 9:24 am
by dsxdev
In a DB2 API Stage you can write your query. if the query works fine at DB2 prompt it would work fine in the job also.

Another solution could be using a Filter Stage in conjunction wiht join Stage. Do a left outer join and send the output of join to a filter Stage wher the condition would be set as date1>date2 and date1<date 3

Posted: Thu Oct 28, 2004 9:30 am
by rcasey
I meant to update this. My issue turned out to be that the OSH could not parse the output schema record because of a coding error on my part. Once I corrected the coding error I re-compiled and it ran with no problem. The coding error was, believe it or not, I actually went into the column names in the stage and coded "t1.dataname", "t2.dataname" etc. OSH could not parse due to the "." in the schema...
Thx