According to a requirement in which we need to fetch SubTeam ID from table TEAM using some field values from REQUEST,PART,ADDRESS tables. This SubTeam ID then should be reflected in one of the REQUEST fields.We have written the sql query to find the particular result and also its corresponding XML that will be used in the XML Business Rule.
SQL QUERY →
select subteam.team_id from request, place, place_address, address, team, subteam, part, request_unit
where 1 = 1
and request.place_id = place.place_id
and request.request_id = request_unit.request_id
and request_unit.part_id=part.part_id
and place.place_id = place_address.place_id
and place_address.address_id = address.address_id
and address.city = team.team_id
and team.team_id = subteam.parent_team_id
and subteam.user_def10=part.part_type
and subteam.user_def11=request.req_type
and subteam.user_def12= '0'
and request.request_id = '853'
XML →
<hierarchy_select>
<attrs>
<attr>subteam.team_id</attr>
</attrs>
<primary_table>subteam</primary_table>
<from>
<table>request</table>
<table>place</table>
<table>request_unit</table>
<table>part</table>
<table>place_address</table>
<table>address</table>
<table>team</table>
<table>subteam</table>
</from>
<where>
<join_constraint>
<constraint>
<left_operand>request.place_id</left_operand>
<operator>eq</operator>
<right_operand>place.place_id</right_operand>
</constraint>
<constraint>
<left_operand>request.request_id</left_operand>
<operator>eq</operator>
<right_operand>request_unit.request_id</right_operand>
</constraint>
<constraint>
<left_operand>place.place_id</left_operand>
<operator>eq</operator>
<right_operand>place_address.place_id</right_operand>
</constraint>
<constraint>
<left_operand>part.part_id</left_operand>
<operator>eq</operator>
<right_operand>request_unit.part_id</right_operand>
</constraint>
<constraint>
<left_operand>address.city</left_operand>
<operator>eq</operator>
<right_operand>team.team_id</right_operand>
</constraint>
<constraint>
<left_operand>team.team_id</left_operand>
<operator>eq</operator>
<right_operand>subteam.parent_team_id</right_operand>
</constraint>
<constraint>
<left_operand>subteam.user_def10</left_operand>
<operator>eq</operator>
<right_operand>part.part_type</right_operand>
</constraint>
<constraint>
<left_operand>subteam.user_def11</left_operand>
<operator>eq</operator>
<right_operand>request.req_type</right_operand>
</constraint>
</join_constraint>
<data_constraint>
<constraint>
<left_operand>request.request_id</left_operand>
<operator>eq</operator>
<right_operand>853</right_operand>
</constraint>
<constraint>
<left_operand>subteam.user_def12</left_operand>
<operator>eq</operator>
<right_operand>0</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
Running this XML on the XML Poster is throwing this error:
The objects "request_unit" and "request_unit" in the FROM clause have the same exposed names
Also this XML is working fine without any error on other Environment but showing this error on IFS FSM 6