[Home] [Help]
95: is
96:
97: cursor get_pps_ssc_csr is
98: select count(*)
99: from hz_orig_sys_references
100: where Owner_table_name = p_owner_table_name
101: and owner_table_id = p_owner_table_id
102: and status = 'A';
103:
102: and status = 'A';
103:
104: cursor get_rel_ssc_csr is
105: select count(*)
106: from hz_orig_sys_references os,hz_org_contacts org
107: where os.owner_table_id = org.org_contact_id
108: and os.owner_table_name = p_owner_table_name
109: and org.org_contact_id = p_owner_table_id
110: and os.status = 'A';
684: p_orig_system_reference in varchar2, p_owner_table_name in varchar2) return varchar2
685: is
686: cursor get_orig_sys_ref_id_csr is
687: SELECT ORIG_SYSTEM_REF_ID
688: FROM HZ_ORIG_SYS_REFERENCES
689: WHERE ORIG_SYSTEM = p_orig_system
690: and ORIG_SYSTEM_REFERENCE = p_orig_system_reference
691: and owner_table_name = p_owner_table_name
692: and status = 'A';
702: p_orig_system_reference in varchar2, p_owner_table_name in varchar2) return date
703: is
704: cursor get_start_date_csr is
705: SELECT start_date_active
706: FROM HZ_ORIG_SYS_REFERENCES
707: WHERE ORIG_SYSTEM = p_orig_system
708: and ORIG_SYSTEM_REFERENCE = p_orig_system_reference
709: and owner_table_name = p_owner_table_name
710: and rownum = 1; -- start/end_date_active only used in update and
727: x_return_status IN OUT NOCOPY VARCHAR2
728: ) is
729: cursor get_pk_by_owner_id is
730: SELECT ORIG_SYSTEM_REF_ID
731: FROM HZ_ORIG_SYS_REFERENCES
732: WHERE ORIG_SYSTEM = p_orig_sys_reference_rec.orig_system
733: and ORIG_SYSTEM_REFERENCE = p_orig_sys_reference_rec.orig_system_reference
734: and owner_table_name = p_orig_sys_reference_rec.owner_table_name
735: and owner_table_id = p_orig_sys_reference_rec.owner_table_id
758: if l_orig_system_ref_id is null
759: then
760: FND_MESSAGE.SET_NAME('AR', 'HZ_API_NO_DATA_FOUND');
761: FND_MESSAGE.SET_TOKEN('COLUMN', 'orig_system+orig_system_reference+owner_table_id');
762: FND_MESSAGE.SET_TOKEN('TABLE', 'HZ_ORIG_SYS_REFERENCES');
763: FND_MSG_PUB.ADD;
764: x_return_status := FND_API.G_RET_STS_ERROR;
765: RAISE FND_API.G_EXC_ERROR;
766: end if;
771: if nvl(l_orig_system_ref_id,p_orig_sys_reference_rec.orig_system_ref_id)<>p_orig_sys_reference_rec.orig_system_ref_id
772: then
773: FND_MESSAGE.SET_NAME('AR', 'HZ_API_NO_DATA_FOUND');
774: FND_MESSAGE.SET_TOKEN('COLUMN', 'orig_system+orig_system_reference+owner_table_id+orig_system_ref_id');
775: FND_MESSAGE.SET_TOKEN('TABLE', 'HZ_ORIG_SYS_REFERENCES');
776: FND_MSG_PUB.ADD;
777: x_return_status := FND_API.G_RET_STS_ERROR;
778: RAISE FND_API.G_EXC_ERROR;
779: end if;
794: elsif l_count = 0
795: then
796: FND_MESSAGE.SET_NAME('AR', 'HZ_API_NO_DATA_FOUND');
797: FND_MESSAGE.SET_TOKEN('COLUMN', 'orig_system+orig_system_reference');
798: FND_MESSAGE.SET_TOKEN('TABLE', 'HZ_ORIG_SYS_REFERENCES');
799: FND_MSG_PUB.ADD;
800: x_return_status := FND_API.G_RET_STS_ERROR;
801: RAISE FND_API.G_EXC_ERROR;
802: elsif l_count = 1
814: ORIG_SYSTEM_REFERENCE
815: INTO l_object_version_number,
816: l_orig_system,
817: l_orig_system_reference
818: FROM HZ_ORIG_SYS_REFERENCES
819: WHERE orig_system_ref_id = l_orig_system_ref_id
820: FOR UPDATE OF ORIG_SYSTEM NOWAIT;
821:
822: IF NOT ((p_object_version_number is null and l_object_version_number is null)
822: IF NOT ((p_object_version_number is null and l_object_version_number is null)
823: OR (p_object_version_number = l_object_version_number))
824: THEN
825: FND_MESSAGE.SET_NAME('AR', 'HZ_API_RECORD_CHANGED');
826: FND_MESSAGE.SET_TOKEN('TABLE', 'HZ_ORIG_SYS_REFERENCES');
827: FND_MSG_PUB.ADD;
828: x_return_status := FND_API.G_RET_STS_ERROR;
829: RAISE FND_API.G_EXC_ERROR;
830: END IF;
832: p_object_version_number := nvl(l_object_version_number, 1) + 1;
833:
834: EXCEPTION WHEN NO_DATA_FOUND THEN
835: FND_MESSAGE.SET_NAME('AR', 'HZ_API_NO_RECORD');
836: FND_MESSAGE.SET_TOKEN('RECORD', 'HZ_ORIG_SYS_REFERENCES');
837: FND_MESSAGE.SET_TOKEN('VALUE', l_orig_system_ref_id);
838: FND_MSG_PUB.ADD;
839: RAISE FND_API.G_EXC_ERROR;
840: END;
928: -- WE BASICALLY WANT TO ENSURE THAT SYNC GETS CALLED ONLY WHEN OWNER_TABLE_ID IS A VALID
929: -- NON-EMPTY STRING IE., IT IS NEITHER FND_G_MISS_CHAR NOR NULL.
930: -- THEREFORE , WE FETCH IT FROM DB.
931: select owner_table_id into l_temp
932: from hz_orig_sys_references
933: where orig_system_ref_id = l_orig_system_ref_id;
934:
935:
936:
1047: /*and status ='A'*/;
1048:
1049: cursor get_orig_system_new is
1050: select 'Y'
1051: from hz_orig_sys_references
1052: where owner_table_id = l_orig_sys_reference_rec.owner_table_id
1053: and owner_table_name = l_orig_sys_reference_rec.owner_table_name
1054: and orig_system = l_orig_sys_reference_rec.orig_system
1055: and status = 'A';
1180: p_orig_system_reference in varchar2, p_owner_table_name in varchar2,p_owner_table_id in number) return varchar2
1181: is
1182: cursor inactive_mosr_exist_csr is
1183: SELECT 'Y'
1184: FROM HZ_ORIG_SYS_REFERENCES
1185: WHERE ORIG_SYSTEM = p_orig_system
1186: and ORIG_SYSTEM_REFERENCE = p_orig_system_reference
1187: and owner_table_name = p_owner_table_name
1188: and owner_table_id = p_owner_table_id
1224: /*and status='A'*/;
1225:
1226: cursor get_orig_system_new is
1227: select 'Y'
1228: from hz_orig_sys_references
1229: where owner_table_id = l_orig_sys_reference_rec.owner_table_id
1230: and owner_table_name = l_orig_sys_reference_rec.owner_table_name
1231: and orig_system = l_orig_sys_reference_rec.orig_system
1232: and status = 'A';
1538: x_msg_data OUT NOCOPY VARCHAR2
1539: ) is
1540: cursor get_orig_system_csr is
1541: select orig_system, orig_system_reference,orig_system_ref_id
1542: from hz_orig_sys_references
1543: where owner_table_id = p_old_owner_table_id
1544: and owner_table_name = p_owner_table_name
1545: and status = 'A'; /* Bug 3235877 */
1546:
1555: cursor get_multi_mosr_flag is
1556: select multi_osr_flag
1557: from hz_orig_sys_mapping
1558: where owner_table_name = p_owner_table_name
1559: and orig_system = (select orig_system from hz_orig_sys_references
1560: where owner_table_id = p_old_owner_table_id
1561: and owner_table_name = p_owner_table_name
1562: and status ='A'
1563: and rownum =1
1564: );
1565:
1566: cursor get_orig_system_new is
1567: select 'Y'
1568: from hz_orig_sys_references
1569: where owner_table_id = p_new_owner_table_id
1570: and owner_table_name = p_owner_table_name
1571: -- Bug 3863486
1572: and orig_system = (select orig_system from hz_orig_sys_references
1568: from hz_orig_sys_references
1569: where owner_table_id = p_new_owner_table_id
1570: and owner_table_name = p_owner_table_name
1571: -- Bug 3863486
1572: and orig_system = (select orig_system from hz_orig_sys_references
1573: where owner_table_id = p_old_owner_table_id
1574: and owner_table_name = p_owner_table_name
1575: and status ='A'
1576: and rownum =1)
1578:
1579: --bug 4261242
1580: cursor check_duplicates is
1581: select 'Y'
1582: from hz_orig_sys_references
1583: where owner_table_id = p_new_owner_table_id
1584: and owner_table_name = p_owner_table_name
1585: and orig_system || orig_system_reference = l_orig_system||l_orig_system_reference
1586: and status = 'A';
1767: IF l_party_merge_flag = FALSE THEN /*Bug 3235877*/
1768: if p_validation_level = FND_API.G_VALID_LEVEL_FULL then--YES
1769: FND_MESSAGE.SET_NAME('AR', 'HZ_API_NO_DATA_FOUND');
1770: FND_MESSAGE.SET_TOKEN('COLUMN', 'orig_system+orig_system_reference+owner_table_id');
1771: FND_MESSAGE.SET_TOKEN('TABLE', 'HZ_ORIG_SYS_REFERENCES');
1772: FND_MSG_PUB.ADD;
1773: x_return_status := FND_API.G_RET_STS_ERROR;
1774: end if;
1775: END IF;
1816: x_msg_data OUT NOCOPY VARCHAR2
1817: ) is
1818: cursor get_orig_system_csr is
1819: select orig_system, orig_system_reference, created_by_module
1820: from hz_orig_sys_references
1821: WHERE owner_table_name = p_owner_table_name
1822: and owner_table_id = p_owner_table_id
1823: and status = 'A';
1824: l_created_by_module varchar2(150);
1831: cursor get_multi_mosr_flag(p_orig_system NUMBER) is
1832: select multi_osr_flag
1833: from hz_orig_sys_mapping
1834: where owner_table_name = p_owner_table_name
1835: and orig_system = (select orig_system from hz_orig_sys_references
1836: where owner_table_id = p_owner_table_id
1837: and owner_table_name = p_owner_table_name
1838: and status = 'A'
1839: and rownum=1