msjumbu
12th March 2002, 16:37
Hi all,
does baan support outer join? if so how do i use it?
evesely
12th March 2002, 18:45
You can use the "REFERS TO ... UNREF" construct for primary keys to accomplish an outer join.
For example:
select tdsls041.*, tcmcs003.*
from tdsls041, tcmcs003
where tdsls041._index1 = {:orno, :pono}
and tdsls041.cwar refers to tcmcs003 unref clear
...
The values for UNREF determine how the fields of the referenced table are populated. The values are:
SKIP -- skip all rows if no match (not an outer join)
CLEAR -- use space or zero for field values
SETUNREF -- use 'undefined reference' characters for field values
CLEARUNREF -- hybrid of CLEAR and SETUNREF. Value depends on foreign key value
In my example, if the value of tdsls041.cwar was not a primary key value of tcmcs003, all of the tcmcs003 field values would be set to spaces or 0.
** The REFERS TO construct works for primary keys. **
I hope this is clear.