I am trying to encode a 3 table query in ds.xml. The first table is joined to 2 others using the same field from the first. Therefore I'm hoping to do something like:
<field name="ID" type="text" length="11" primaryKey="true" foreignKey="studentPlan.ID" foreignKey="previousTerms.ID">
This of course seems to not work. Is there a way to specify that a field functions as a foreignKey to multiple other datasources without having to chain the relation through intermediate datasources?
The query I'm hoping to encode is:
select
t1.ID,
least(min(to_number(t1.TERM,'9999')),min(TO_NUMBER(t2.TERM,'9999'))) as firstTerm
from UW.STDNT_MULTITERM t1
left outer join UW.RETENTION_COURSE_HISTORY t2 on t1.ID=t2.ID
inner join UW.STDNT_PLAN_MULTITERM t3 on t3.ID=t1.ID
where t1.CAREER='GRAD'
and t3.PLAN_GROUP='148'
and t3.PLAN_TYPE='MAJ'
and t1.TERM='1184'
GROUP BY t1.ID;
<field name="ID" type="text" length="11" primaryKey="true" foreignKey="studentPlan.ID" foreignKey="previousTerms.ID">
This of course seems to not work. Is there a way to specify that a field functions as a foreignKey to multiple other datasources without having to chain the relation through intermediate datasources?
The query I'm hoping to encode is:
select
t1.ID,
least(min(to_number(t1.TERM,'9999')),min(TO_NUMBER(t2.TERM,'9999'))) as firstTerm
from UW.STDNT_MULTITERM t1
left outer join UW.RETENTION_COURSE_HISTORY t2 on t1.ID=t2.ID
inner join UW.STDNT_PLAN_MULTITERM t3 on t3.ID=t1.ID
where t1.CAREER='GRAD'
and t3.PLAN_GROUP='148'
and t3.PLAN_TYPE='MAJ'
and t1.TERM='1184'
GROUP BY t1.ID;
Comment