Monday, September 21, 2009

OWB 10.2.0.4 outer join PEBKAC fix

Looking at a join Mr. someone-else had made in a OWB mapping I found the following conditions:
a.column1 = (+) b.column1 AND
a.column2 = (+) b.column2
Noway this can work! However the mapping was running smoothly. OWB actually changes the place of the (+) to the correct location when generating the SQL so that the final statement looks like:
a.column1 = b.column1 (+) AND
a.column2 = b.column2 (+)
I was totally amazed by this.

2 comments:

Øyvind Larsen said...

OWB does lots of smart things with outer joins. If you specify a.column1(+) = b.column1(+) it will actually rewrite this to be a FULL OUTER JOIN.

bakkushan said...

When I started using other databases, I found it extremely cumbersome to write the OUTER JOIN specifications elsewhere.

SELECT a.col3 FROM bartab a LEFT OUTER JOIN gazonktab b ON (a.col1 = b.col1) LEFT OUTER JOIN znorbletab c ON (b.col2 = c.col2)

Gods.