<?xml version="1.0" encoding="UTF-8"?>

<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT *
                FROM (SELECT li.attribute_6,
                li.attribute_13,
                li.attribute_18,
                li.line_id,
                li.error_message,
                li.header_id
                FROM fnd_interface_lines li, fnd_interface_headers hd
                WHERE hd.header_id = li.header_id
                AND hd.template_code = 'dcs_n'
                AND HD.CREATED_BY = ${/session/@user_id}
                AND li.line_number > 0
                AND li.header_id =
                (SELECT MAX(li.header_id)
                FROM fnd_interface_lines li, fnd_interface_headers hd
                WHERE li.header_id = hd.header_id
                AND hd.template_code = 'dcs_n'
                AND HD.CREATED_BY = ${/session/@user_id})) t1
                ORDER BY t1.line_id ASC
                #WHERE_CLAUSE#
                ]]>
            </bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                hlcm_op_asset_depre_pkg.equipment_number_check(
                p_header_id => ${/model/header/record/@header_id},
                p_user_id => ${/session/@user_id}
                );
                end;
                ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>

    <bm:query-fields>

    </bm:query-fields>


</bm:model>
