723:
724: cursor C_REFERENCE_FOR is select relationship_id from
725: hz_relationships where subject_id = c_party_id
726: and relationship_code = 'REFERENCE_FOR'
727: and subject_table_name = 'HZ_PARTIES'
728: AND object_table_name = 'HZ_PARTIES'
729: AND directional_flag = 'F';
730: x_party_last_update_date date;
731: X_PARTY_REL_LAST_UPDATE_DATE date;
724: cursor C_REFERENCE_FOR is select relationship_id from
725: hz_relationships where subject_id = c_party_id
726: and relationship_code = 'REFERENCE_FOR'
727: and subject_table_name = 'HZ_PARTIES'
728: AND object_table_name = 'HZ_PARTIES'
729: AND directional_flag = 'F';
730: x_party_last_update_date date;
731: X_PARTY_REL_LAST_UPDATE_DATE date;
732:
732:
733: cursor C_PARTNER_OF is select relationship_id from
734: hz_relationships where subject_id = c_party_id
735: and relationship_code = 'PARTNER_OF'
736: and subject_table_name = 'HZ_PARTIES'
737: and object_table_name = 'HZ_PARTIES'
738: and directional_flag = 'F';
739:
740: cursor C_COMPETITOR_OF is select relationship_id from
733: cursor C_PARTNER_OF is select relationship_id from
734: hz_relationships where subject_id = c_party_id
735: and relationship_code = 'PARTNER_OF'
736: and subject_table_name = 'HZ_PARTIES'
737: and object_table_name = 'HZ_PARTIES'
738: and directional_flag = 'F';
739:
740: cursor C_COMPETITOR_OF is select relationship_id from
741: hz_relationships where subject_id = c_party_id
739:
740: cursor C_COMPETITOR_OF is select relationship_id from
741: hz_relationships where subject_id = c_party_id
742: and relationship_code = 'COMPETITOR_OF'
743: and subject_table_name = 'HZ_PARTIES'
744: and object_table_name = 'HZ_PARTIES'
745: and directional_flag = 'F';
746:
747: begin
740: cursor C_COMPETITOR_OF is select relationship_id from
741: hz_relationships where subject_id = c_party_id
742: and relationship_code = 'COMPETITOR_OF'
743: and subject_table_name = 'HZ_PARTIES'
744: and object_table_name = 'HZ_PARTIES'
745: and directional_flag = 'F';
746:
747: begin
748: /*
1111: /* select last_update_date into x_party_rel_last_update_date
1112: from hz_party_relationships where party_relationship_id = x_party_rel_id;
1113:
1114: select last_update_date into x_party_last_update_date
1115: from hz_parties where party_id = c_party_id;*/
1116:
1117: select object_version_number into l_object_version_number
1118: from hz_relationships where relationship_id = x_party_rel_id;
1119:
1117: select object_version_number into l_object_version_number
1118: from hz_relationships where relationship_id = x_party_rel_id;
1119:
1120: select object_version_number into l_party_object_version_number
1121: from hz_parties where party_id = c_party_id;
1122:
1123: prel_rec.relationship_id := x_party_rel_id;
1124: if C_Reference_Use_Flag = 'N' then
1125: prel_rec.end_date := sysdate;
1196: /* select last_update_date into x_party_rel_last_update_date
1197: from hz_party_relationships where party_relationship_id = x_party_rel_id;
1198:
1199: select last_update_date into x_party_last_update_date
1200: from hz_parties where party_id = c_party_id;*/
1201:
1202: select object_version_number into l_object_version_number
1203: from hz_relationships where relationship_id = x_party_rel_id;
1204:
1202: select object_version_number into l_object_version_number
1203: from hz_relationships where relationship_id = x_party_rel_id;
1204:
1205: select object_version_number into l_party_object_version_number
1206: from hz_parties where party_id = c_party_id;
1207:
1208: prel_rec.relationship_id := x_party_rel_id;
1209: if C_Third_Party_Flag = 'N' then
1210: prel_rec.end_date := sysdate;
1283: /*select last_update_date,object_version_number into x_party_rel_last_update_date,l_object_version_number
1284: from hz_party_relationships where party_relationship_id = x_party_rel_id;
1285:
1286: select last_update_date into x_party_last_update_date
1287: from hz_parties where party_id = c_party_id;*/
1288:
1289: select object_version_number into l_object_version_number
1290: from hz_relationships where relationship_id = x_party_rel_id;
1291:
1289: select object_version_number into l_object_version_number
1290: from hz_relationships where relationship_id = x_party_rel_id;
1291:
1292: select object_version_number into l_party_object_version_number
1293: from hz_parties where party_id = c_party_id;
1294:
1295: prel_rec.relationship_id := x_party_rel_id;
1296: if c_competitor_flag = 'N' then
1297: prel_rec.end_date := sysdate;