DBA Data[Home] [Help]

APPS.CSI_DIAGNOSTICS_PKG dependencies on CSI_I_ORG_ASSIGNMENTS

Line 540: select CSI_I_ORG_ASSIGNMENTS_H_S.nextval

536: ,p_org_hist_tbl IN OUT NOCOPY csi_diagnostics_pkg.T_NUM
537: ) IS
538: BEGIN
539: FOR i in p_org_tbl.FIRST .. p_org_tbl.LAST LOOP
540: select CSI_I_ORG_ASSIGNMENTS_H_S.nextval
541: into p_org_hist_tbl(i) from dual;
542: --
543: p_org_units_rec_tab.instance_ou_id(i) := p_org_tbl(i).instance_ou_id;
544: p_org_units_rec_tab.instance_id(i) := p_org_tbl(i).instance_id;

Line 963: FROM csi_i_org_assignments

959: x_ou_tbl(l_ind).attribute14 := p_ou_h_tbl(l_ind).attribute14;
960: x_ou_tbl(l_ind).attribute15 := p_ou_h_tbl(l_ind).attribute15;
961: SELECT object_version_number
962: INTO x_ou_tbl(l_ind).object_version_number
963: FROM csi_i_org_assignments
964: WHERE instance_ou_id = p_ou_h_tbl(l_ind).instance_ou_id;
965:
966: END LOOP;
967: END IF;

Line 2233: INSERT INTO CSI_I_ORG_ASSIGNMENTS_H(

2229: --
2230: -- Insert into History
2231: log('Before Inserting into Org Assignments history');
2232: FORALL i in 1 .. l_org_units_rec_tab.instance_ou_id.count
2233: INSERT INTO CSI_I_ORG_ASSIGNMENTS_H(
2234: INSTANCE_OU_HISTORY_ID,
2235: INSTANCE_OU_ID,
2236: TRANSACTION_ID,
2237: NEW_OPERATING_UNIT_ID,

Line 15913: from csi_i_org_assignments

15909: --
15910: PROCEDURE Delete_Dup_Org_Assignments IS
15911: cursor csi_dup_cur is
15912: select instance_id,relationship_type_code
15913: from csi_i_org_assignments
15914: group by instance_id,relationship_type_code
15915: having count(*) > 1;
15916: --
15917: cursor csi_org_cur(p_instance_id in number,p_rel_type_code in varchar2) is

Line 15919: from csi_i_org_assignments

15915: having count(*) > 1;
15916: --
15917: cursor csi_org_cur(p_instance_id in number,p_rel_type_code in varchar2) is
15918: select *
15919: from csi_i_org_assignments
15920: where instance_id = p_instance_id
15921: and relationship_type_code = p_rel_type_code
15922: order by creation_date asc;
15923: --

Line 15925: select coah.* from csi_i_org_assignments_h coah,

15921: and relationship_type_code = p_rel_type_code
15922: order by creation_date asc;
15923: --
15924: cursor csi_org_hist_cur(p_instance_id in number,p_rel_type_code in varchar2) is
15925: select coah.* from csi_i_org_assignments_h coah,
15926: csi_i_org_assignments coa
15927: where coa.instance_id = p_instance_id
15928: and coa.relationship_type_code = p_rel_type_code
15929: and coah.instance_ou_id = coa.instance_ou_id

Line 15926: csi_i_org_assignments coa

15922: order by creation_date asc;
15923: --
15924: cursor csi_org_hist_cur(p_instance_id in number,p_rel_type_code in varchar2) is
15925: select coah.* from csi_i_org_assignments_h coah,
15926: csi_i_org_assignments coa
15927: where coa.instance_id = p_instance_id
15928: and coa.relationship_type_code = p_rel_type_code
15929: and coah.instance_ou_id = coa.instance_ou_id
15930: order by coah.transaction_id,coah.last_update_date asc;

Line 15941: TYPE ORG_HIST_TBL IS TABLE OF CSI_I_ORG_ASSIGNMENTS_H%ROWTYPE INDEX BY BINARY_INTEGER;

15937: l_row_count NUMBER;
15938: l_del_count NUMBER := 0;
15939: TYPE NumList IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
15940: l_del_tbl NumList;
15941: TYPE ORG_HIST_TBL IS TABLE OF CSI_I_ORG_ASSIGNMENTS_H%ROWTYPE INDEX BY BINARY_INTEGER;
15942: l_org_hist_tbl ORG_HIST_TBL;
15943: l_hist_count NUMBER;
15944: v_ret_ou_id NUMBER;
15945: l_prev_rec csi_org_hist_cur%ROWTYPE;

Line 15959: from csi_i_org_assignments

15955: v_max_ou_id := -9999;
15956: Begin
15957: select instance_ou_id
15958: into v_max_ou_id
15959: from csi_i_org_assignments
15960: where instance_id = dup_rec.instance_id
15961: and relationship_type_code = dup_rec.relationship_type_code
15962: and creation_date = ( select max(creation_date)
15963: from csi_i_org_assignments

Line 15963: from csi_i_org_assignments

15959: from csi_i_org_assignments
15960: where instance_id = dup_rec.instance_id
15961: and relationship_type_code = dup_rec.relationship_type_code
15962: and creation_date = ( select max(creation_date)
15963: from csi_i_org_assignments
15964: where instance_id = dup_rec.instance_id
15965: and relationship_type_code = dup_rec.relationship_type_code
15966: and nvl(active_end_date,(sysdate+1)) > sysdate)
15967: and nvl(active_end_date,(sysdate+1)) > sysdate

Line 15973: from csi_i_org_assignments

15969: Exception
15970: when no_data_found then
15971: select max(instance_ou_id)
15972: into v_max_ou_id
15973: from csi_i_org_assignments
15974: where instance_id = dup_rec.instance_id
15975: and relationship_type_code = dup_rec.relationship_type_code;
15976: End;
15977: --

Line 15989: UPDATE CSI_I_ORG_ASSIGNMENTS

15985: FOR org_rec in csi_org_cur(dup_rec.instance_id,dup_rec.relationship_type_code) LOOP
15986: l_row_count := l_row_count + 1;
15987: IF l_row_count = 1 THEN
15988: v_ret_ou_id := org_rec.instance_ou_id;
15989: UPDATE CSI_I_ORG_ASSIGNMENTS
15990: set (operating_unit_id,active_end_date,context,attribute1,attribute2,attribute3,
15991: attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,
15992: attribute11,attribute12,attribute13,attribute14,attribute15,last_update_date) =
15993: (select operating_unit_id,active_end_date,context,attribute1,attribute2,attribute3,

Line 15996: from csi_i_org_assignments

15992: attribute11,attribute12,attribute13,attribute14,attribute15,last_update_date) =
15993: (select operating_unit_id,active_end_date,context,attribute1,attribute2,attribute3,
15994: attribute4,attribute5,attribute6,attribute7,attribute8,attribute9,attribute10,
15995: attribute11,attribute12,attribute13,attribute14,attribute15,sysdate
15996: from csi_i_org_assignments
15997: where instance_ou_id = v_max_ou_id)
15998: where instance_ou_id = org_rec.instance_ou_id;
15999: ELSE
16000: l_del_count := l_del_count + 1;

Line 16152: update csi_i_org_assignments_h

16148: END IF;
16149: --
16150: ELSE -- Txn id not same
16151: IF l_flag = 'Y' THEN
16152: update csi_i_org_assignments_h
16153: set old_operating_unit_id = l_prev_rec.old_operating_unit_id,
16154: new_operating_unit_id = l_prev_rec.new_operating_unit_id,
16155: old_relationship_type_code = l_prev_rec.old_relationship_type_code,
16156: new_relationship_type_code = l_prev_rec.new_relationship_type_code,

Line 16197: delete from csi_i_org_assignments_h

16193: last_update_date = sysdate
16194: where instance_ou_history_id = l_prev_rec.instance_ou_history_id;
16195: --
16196: FORALL i in 1..l_del_ou_hist_tbl.count
16197: delete from csi_i_org_assignments_h
16198: where instance_ou_history_id = l_del_ou_hist_tbl(i);
16199: --
16200: l_flag := 'N';
16201: l_del_ou_hist_tbl.DELETE;

Line 16209: update csi_i_org_assignments_h

16205: END IF;
16206: END LOOP;
16207: -- Update the instance_ou_id with the one that is retained
16208: IF l_flag = 'Y' THEN -- Just in case the last record in the loop matches with prev txn
16209: update csi_i_org_assignments_h
16210: set old_operating_unit_id = l_prev_rec.old_operating_unit_id,
16211: new_operating_unit_id = l_prev_rec.new_operating_unit_id,
16212: old_relationship_type_code = l_prev_rec.old_relationship_type_code,
16213: new_relationship_type_code = l_prev_rec.new_relationship_type_code,

Line 16254: delete from csi_i_org_assignments_h

16250: last_update_date = sysdate
16251: where instance_ou_history_id = l_prev_rec.instance_ou_history_id;
16252: --
16253: FORALL i in 1..l_del_ou_hist_tbl.count
16254: delete from csi_i_org_assignments_h
16255: where instance_ou_history_id = l_del_ou_hist_tbl(i);
16256: --
16257: l_flag := 'N';
16258: l_del_ou_hist_tbl.DELETE;

Line 16262: update csi_i_org_assignments_h

16258: l_del_ou_hist_tbl.DELETE;
16259: END IF;
16260: --
16261: FOR x in l_org_hist_tbl.FIRST .. l_org_hist_tbl.LAST LOOP
16262: update csi_i_org_assignments_h
16263: set instance_ou_id = v_ret_ou_id,
16264: last_update_date = sysdate
16265: where instance_ou_history_id = l_org_hist_tbl(x).instance_ou_history_id;
16266: END LOOP;

Line 16271: DELETE FROM CSI_I_ORG_ASSIGNMENTS

16267: END IF;
16268: --
16269: -- Delete the Duplicate Org Assignments
16270: FORALL x in l_del_tbl.FIRST .. l_del_tbl.LAST
16271: DELETE FROM CSI_I_ORG_ASSIGNMENTS
16272: where instance_ou_id = l_del_tbl(x);
16273: commit;
16274: Exception
16275: when Process_next then