The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT meaning
FROM ar_lookups
WHERE lookup_code = p_lookup_code
and lookup_type = 'HZ_RELATIONSHIP_ROLE'
and rownum = 1 ;
SELECT description
FROM ar_lookups
WHERE lookup_code = p_lookup_code
and lookup_type = 'HZ_RELATIONSHIP_ROLE'
and rownum = 1 ;
SELECT COUNT(*)
INTO l_count
FROM FND_LOOKUP_VALUES
WHERE lookup_type = 'HZ_RELATIONSHIP_ROLE'
AND (meaning = p_lookup_meaning
OR description = p_lookup_description);
FND_LOOKUP_VALUES_PKG.INSERT_ROW(
X_ROWID => x_rowid,
X_LOOKUP_TYPE => 'HZ_RELATIONSHIP_ROLE',
X_SECURITY_GROUP_ID => 0,
X_VIEW_APPLICATION_ID => 222,
X_LOOKUP_CODE => p_lookup_code,
X_TAG => null,
X_ATTRIBUTE_CATEGORY => null,
X_ATTRIBUTE1 => null,
X_ATTRIBUTE2 => null,
X_ATTRIBUTE3 => null,
X_ATTRIBUTE4 => null,
X_ENABLED_FLAG => 'Y',
X_START_DATE_ACTIVE => null,
X_END_DATE_ACTIVE => null,
X_TERRITORY_CODE => null,
X_ATTRIBUTE5 => null,
X_ATTRIBUTE6 => null,
X_ATTRIBUTE7 => null,
X_ATTRIBUTE8 => null,
X_ATTRIBUTE9 => null,
X_ATTRIBUTE10 => null,
X_ATTRIBUTE11 => null,
X_ATTRIBUTE12 => null,
X_ATTRIBUTE13 => null,
X_ATTRIBUTE14 => null,
X_ATTRIBUTE15 => null,
X_MEANING => p_lookup_meaning,
X_DESCRIPTION => p_lookup_description,
X_CREATION_DATE => HZ_UTILITY_V2PUB.CREATION_DATE,
X_CREATED_BY => HZ_UTILITY_V2PUB.CREATED_BY,
X_LAST_UPDATE_DATE => HZ_UTILITY_V2PUB.LAST_UPDATE_DATE,
X_LAST_UPDATED_BY => HZ_UTILITY_V2PUB.LAST_UPDATED_BY,
X_LAST_UPDATE_LOGIN => HZ_UTILITY_V2PUB.LAST_UPDATE_LOGIN
);
SELECT party_name
FROM hz_parties
WHERE party_id = p_party_id;
SELECT r.relationship_id,
r.subject_id,
r.subject_table_name,
r.subject_type,
r.start_date,
r.end_date
FROM hz_relationships r,
hz_relationship_types t
WHERE r.object_id = p_child_id
AND r.object_table_name = p_child_table_name
AND r.object_type = p_child_type
AND r.relationship_type = p_rel_type
AND r.relationship_type = t.relationship_type
AND r.relationship_code = t.forward_rel_code
AND r.subject_type = t.subject_type
AND r.object_type = t.object_type
AND t.direction_code = 'P'
AND (r.start_date BETWEEN NVL(p_start_date, SYSDATE)
AND NVL(p_end_date, TO_DATE('31-12-4712 00:00:01', 'DD-MM-YYYY HH24:MI:SS'))
OR
r.end_date BETWEEN NVL(p_start_date, SYSDATE)
AND NVL(p_end_date, TO_DATE('31-12-4712 00:00:01', 'DD-MM-YYYY HH24:MI:SS'))
OR
NVL(p_start_date, SYSDATE) BETWEEN r.start_date AND r.end_date
OR
NVL(p_end_date, TO_DATE('31-12-4712 00:00:01', 'DD-MM-YYYY HH24:MI:SS')) BETWEEN r.start_date AND r.end_date
);
select relationship_id
FROM hz_relationships r,
hz_relationship_types t
where r.relationship_type = p_source_rel_type
AND r.relationship_type = t.relationship_type
AND t.relationship_type = p_source_rel_type
AND r.relationship_code = t.forward_rel_code
AND r.subject_type = t.subject_type
AND r.object_type = t.object_type
AND (r.end_date is null or trunc(r.end_date) >= p_rel_valid_date)
AND trunc(r.start_date) <= p_rel_valid_date
AND directional_flag='F'
;
PROCEDURE copy_selected_phrase_pair(p_source_rel_type VARCHAR2 , p_dest_rel_type VARCHAR2,
p_dest_rel_type_role_prefix VARCHAR2, p_dest_rel_type_role_suffix VARCHAR2,
p_forward_rel_code VARCHAR2, p_backward_rel_code VARCHAR2,
p_subject_type VARCHAR2, p_object_type VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2)
IS
p_relationship_type_rec HZ_RELATIONSHIP_TYPE_V2PUB.RELATIONSHIP_TYPE_REC_TYPE;
select hrt1.relationship_type as relationship_type,
hrt1.direction_code as direction_code,
hrt1.role as forward_role,
hrt2.role as backward_role,
hrt1.forward_rel_code as forward_rel_code,
hrt1.backward_rel_code as backward_rel_code,
hrt1.hierarchical_flag as hierarchical_flag,
hrt1.create_party_flag as create_party_flag,
hrt1.allow_relate_to_self_flag as allow_relate_to_self_flag,
hrt1.allow_circular_relationships as allow_circular_relationships,
hrt1.subject_type as subject_type,
hrt1.object_type as object_type,
hrt1.status as status,
hrt1.created_by_module as created_by_module,
hrt1.application_id as application_id,
hrt1.multiple_parent_allowed as multiple_parent_allowed,
hrt1.incl_unrelated_entities as incl_unrelated_entities
from hz_relationship_types hrt1, hz_relationship_types hrt2
where hrt1.relationship_type = hrt2.relationship_type
and hrt1.subject_type = hrt2.object_type
and hrt1.object_type = hrt2.subject_type
and hrt1.forward_rel_code = hrt2.backward_rel_code
and hrt1.backward_rel_code = hrt2.forward_rel_code
and (hrt1.direction_code = 'P' or hrt1.direction_code = 'N')
-- Constraints based on what is passed in to this function
and hrt1.relationship_type = p_source_rel_type
and hrt1.forward_rel_code = p_forward_rel_code
and hrt1.backward_rel_code = p_backward_rel_code
and hrt1.subject_type = p_subject_type
and hrt1.object_type = p_object_type ;
FND_MESSAGE.SET_TOKEN('PROC' ,'COPY_SELECTED_PHRASE_PAIR');
select relationship_id
from hz_relationships
where subject_id = p_party_id
and relationship_type = p_source_rel_type
and direction_code = 'P'
and (end_date is null or end_date > p_rel_valid_date )
and start_date < p_rel_valid_date ;
select hrt1.relationship_type as relationship_type,
hrt1.direction_code as direction_code,
hrt1.role as forward_role,
hrt2.role as backward_role,
hrt1.forward_rel_code as forward_rel_code,
hrt1.backward_rel_code as backward_rel_code,
hrt1.hierarchical_flag as hierarchical_flag,
hrt1.create_party_flag as create_party_flag,
hrt1.allow_relate_to_self_flag as allow_relate_to_self_flag,
hrt1.allow_circular_relationships as allow_circular_relationships,
hrt1.subject_type as subject_type,
hrt1.object_type as object_type,
hrt1.status as status,
hrt1.created_by_module as created_by_module,
hrt1.application_id as application_id,
hrt1.multiple_parent_allowed as multiple_parent_allowed,
hrt1.incl_unrelated_entities as incl_unrelated_entities
from hz_relationship_types hrt1, hz_relationship_types hrt2
where hrt1.relationship_type = hrt2.relationship_type
and hrt1.subject_type = hrt2.object_type
and hrt1.object_type = hrt2.subject_type
and hrt1.forward_rel_code = hrt2.backward_rel_code
and hrt1.backward_rel_code = hrt2.forward_rel_code
and (hrt1.direction_code = 'P' or hrt1.direction_code = 'N')
and hrt1.relationship_type = p_source_rel_type ;
select * from
hz_relationship_types
where relationship_type = p_source_rel_type
and (direction_code = 'P' or direction_code = 'N')
and (forward_rel_code, backward_rel_code, subject_type, object_type) not in
(select forward_rel_code, backward_rel_code, subject_type, object_type
from hz_relationship_types
where relationship_type = p_dest_rel_type );
copy_selected_phrase_pair(p_source_rel_type,p_dest_rel_type,
p_dest_rel_type_role_prefix, p_dest_rel_type_role_suffix,
rel_type_rec.forward_rel_code, rel_type_rec.backward_rel_code,
rel_type_rec.subject_type, rel_type_rec.object_type,
x_return_status, x_msg_count, x_msg_data );
SELECT r.relationship_id,
r.status,
r.subject_id,
r.subject_table_name,
r.subject_type,
r.object_id,
r.object_table_name,
r.object_type,
r.start_date,
r.end_date,
r.relationship_code,
t.backward_rel_code
FROM hz_relationships r,
hz_relationship_types t
WHERE r.relationship_type = p_rel_type
AND r.relationship_type = t.relationship_type
AND t.relationship_type = p_rel_type
AND r.relationship_code = t.forward_rel_code
AND r.subject_type = t.subject_type
AND r.object_type = t.object_type
AND t.direction_code = 'P';
DELETE hz_hierarchy_nodes
WHERE hierarchy_type = p_rel_type;
g_parent_nodes_tbl.DELETE;
g_relationship_id_tbl.DELETE;
UPDATE hz_relationships
SET direction_code = 'P'
WHERE direction_code IS NULL
AND relationship_id = i_relationship_id(i)
AND relationship_type = p_rel_type
AND relationship_code = i_relationship_code(i)
AND subject_type = i_parent_type(i)
AND object_type = i_child_type(i);
UPDATE hz_relationships
SET direction_code = 'C'
WHERE direction_code IS NULL
AND relationship_id = i_relationship_id(i)
AND relationship_type = p_rel_type
AND relationship_code = i_backward_rel_code(i)
AND subject_type = i_child_type(i)
AND object_type = i_parent_type(i);
SELECT meaning
INTO l_meaning
FROM ar_lookups
WHERE lookup_type = 'HZ_RELATIONSHIP_TYPE'
AND lookup_code = p_rel_type;
UPDATE HZ_RELATIONSHIP_TYPES
SET HIERARCHICAL_FLAG = 'Y',
MULTIPLE_PARENT_ALLOWED = 'N',
INCL_UNRELATED_ENTITIES = 'N',
ALLOW_CIRCULAR_RELATIONSHIPS = 'N',
-- Bug 3615970: point 5
ALLOW_RELATE_TO_SELF_FLAG = 'N',
-- Bug 3615905: set DO_NOT_ALLOW_CONVERT
DO_NOT_ALLOW_CONVERT = 'Y'
WHERE RELATIONSHIP_TYPE = p_rel_type;