781: -- API Body
782:
783: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
784: INTO l_object_m_id
785: FROM dual;
786: --Template id should be from object_id of the M record
787: l_template_id := l_object_m_id;
788:
789: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
787: l_template_id := l_object_m_id;
788:
789: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
790: INTO l_object_e_id
791: FROM dual;
792:
793: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
794: INTO l_object_c_id
795: FROM dual;
791: FROM dual;
792:
793: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
794: INTO l_object_c_id
795: FROM dual;
796:
797: -- Get the instance name to append to template name
798: SELECT instance_description
799: INTO l_instance_name
1621:
1622: -- Object id is unique - ws id
1623: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
1624: INTO l_object_id
1625: FROM dual;
1626:
1627: -- Retrieving the master template row
1628: FOR l_dist_template_row_rec IN dist_template_csr
1629: LOOP -- only one record
1708:
1709: -- Object id is unique = ws id
1710: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
1711: INTO l_object_id
1712: FROM dual;
1713:
1714: l_insert_type := 'Insert';
1715:
1716: -- Retrieving the master template row
2089: l_insert_type := 'Insert';
2090: -- Object id is unique - ws id
2091: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
2092: INTO l_object_id
2093: FROM dual;
2094:
2095: ELSIF (l_count > 0) THEN -- distributed before
2096: l_insert_type := 'Update';
2097: SELECT object_id
2179: l_insert_type := 'Insert';
2180: -- Object id is unique = ws id
2181: SELECT ZPB_TEMPLATE_WS_ID_SEQ.nextval
2182: INTO l_object_id
2183: FROM dual;
2184:
2185: ELSIF (l_count > 0) THEN
2186: l_insert_type := 'Update';
2187: SELECT object_id