The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and object_id = p_object_id
and actual_content_source = 'DNB'
and relationship_type = p_relationship_type
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id, start_date
FROM hz_relationships
WHERE relationship_code = 'PARENT_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and object_id <> subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id
FROM hz_relationships
WHERE relationship_code = 'PARENT_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and object_id <> subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id, start_date
FROM hz_relationships
WHERE relationship_code = 'HEADQUARTERS_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and object_id <> subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id
FROM hz_relationships
WHERE relationship_code = 'HEADQUARTERS_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and object_id <> subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id, start_date
FROM hz_relationships
WHERE relationship_code = 'DOMESTIC_ULTIMATE_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id
FROM hz_relationships
WHERE relationship_code = 'DOMESTIC_ULTIMATE_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id, start_date
FROM hz_relationships
WHERE relationship_code = 'GLOBAL_ULTIMATE_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id
FROM hz_relationships
WHERE relationship_code = 'GLOBAL_ULTIMATE_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id
FROM hz_relationships
WHERE relationship_code = 'SUBSIDIARY_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and object_id <> subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT subject_id
FROM hz_relationships
WHERE relationship_code = 'DIVISION_OF'
and relationship_type = p_relationship_type
and actual_content_source = 'DNB'
and object_id = p_subject_id
and object_id <> subject_id
and (end_date is null
or end_date > sysdate) ;
SELECT object_id
FROM hz_relationships
WHERE relationship_type = p_relationship_type
and (relationship_code = 'GLOBAL_SUBSIDIARY_OF'
or relationship_code = 'DOMESTIC_SUBSIDIARY_OF'
or relationship_code = 'DIVISION_OF'
or relationship_code = 'SUBSIDIARY_OF')
and actual_content_source = 'DNB'
and subject_id = p_subject_id
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and relationship_type = 'DNB_HIERARCHY'
and rownum = 1
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = gup_subject_id
and relationship_type = 'DNB_HIERARCHY'
and rownum = 1
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where object_id = p_subject_id
and relationship_code = 'HEADQUARTERS_OF'
and relationship_type = 'DNB_HIERARCHY'
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where object_id = p_subject_id
and relationship_code = 'PARENT_OF'
and relationship_type = 'DNB_HIERARCHY'
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and object_id = gup_subject_id
and relationship_code = 'GLOBAL_SUBSIDIARY_OF'
and relationship_type = 'DNB_HIERARCHY'
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and relationship_code = 'DOMESTIC_SUBSIDIARY_OF'
and relationship_type = 'DNB_HIERARCHY'
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and relationship_code = 'GLOBAL_ULTIMATE_OF'
and relationship_type = 'DNB_HIERARCHY'
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and relationship_type = p_relationship_type
and relationship_code = 'GLOBAL_ULTIMATE_OF'
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and relationship_type = p_relationship_type
and relationship_code = 'DOMESTIC_ULTIMATE_OF'
and (end_date is null
or end_date > sysdate) ;
select hl.country from
hz_locations hl, hz_party_sites hps
where hl.location_id=hps.location_id
and hps.party_id = p1;
select relationship_id
from hz_relationships
where subject_id = p_subject_id
and relationship_type = p_relationship_type
and object_id = p_object_id
and relationship_code = p_relationship_code ;
SELECT object_version_number INTO x_object_version_number
FROM hz_relationships
WHERE relationship_id = x_relationship_id
AND subject_table_name = 'HZ_PARTIES'
AND object_table_name = 'HZ_PARTIES'
AND directional_flag = 'F';
hz_relationship_v2pub.update_relationship ('T', x_relationship_rec,
x_object_version_number, x_party_object_version_number,x_return_status, x_msg_count, x_msg_data );
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and actual_content_source = 'DNB'
and relationship_type = 'DNB_HIERARCHY'
and (relationship_code = 'GLOBAL_SUBSIDIARY_OF'
or relationship_code = 'DOMESTIC_SUBSIDIARY_OF'
or relationship_code = 'DIVISION_OF'
or relationship_code = 'SUBSIDIARY_OF')
and (end_date is null
or end_date > sysdate) ;
select 'Y'
from hz_relationships
where subject_id = p_subject_id
and object_id = gup_subject_id
and actual_content_source = 'DNB'
and relationship_type = 'DNB_HIERARCHY'
and (relationship_code = 'GLOBAL_SUBSIDIARY_OF'
or relationship_code = 'DOMESTIC_SUBSIDIARY_OF'
or relationship_code = 'DIVISION_OF'
or relationship_code = 'SUBSIDIARY_OF')
and (end_date is null
or end_date > sysdate) ;
select subject_id, relationship_code
from hz_relationships
where object_id = p_subject_id
and actual_content_source = 'DNB'
and relationship_type = 'DNB_HIERARCHY'
and (relationship_code = 'GLOBAL_SUBSIDIARY_OF'
or relationship_code = 'DOMESTIC_SUBSIDIARY_OF'
or relationship_code = 'DIVISION_OF'
or relationship_code = 'SUBSIDIARY_OF')
and (end_date is null
or end_date > sysdate) ;
select subject_id
from hz_relationships rel
where rel.actual_content_source = 'DNB'
and rel.relationship_type in ( 'PARENT/SUBSIDIARY' , 'HEADQUARTERS/DIVISION' )
and rel.relationship_code in ( 'SUBSIDIARY_OF' , 'DIVISION_OF' )
and ( rel.end_date is null
or rel.end_date > sysdate )
and rel.object_table_name='HZ_PARTIES'
and rel.object_type='ORGANIZATION'
and rel.subject_table_name='HZ_PARTIES'
and rel.subject_type='ORGANIZATION'
and rel.directional_flag in ('F','B')
and rel.status='A'
and not exists ( select 1
from hz_relationships
where relationship_type in ( 'PARENT/SUBSIDIARY' , 'HEADQUARTERS/DIVISION' )
and relationship_code in ( 'PARENT_OF' , 'HEADQUARTERS_OF' )
and subject_table_name='HZ_PARTIES'
and subject_type='ORGANIZATION'
and ( end_date is null
or end_date > sysdate )
and actual_content_source = 'DNB'
and status='A'
and subject_id=rel.subject_id);
select rel.subject_id
from hz_relationships rel
where rel.actual_content_source = 'DNB'
and rel.relationship_code in ( 'SUBSIDIARY_OF' , 'DIVISION_OF' )
and ( rel.end_date is null
or rel.end_date > sysdate )
and rel.object_table_name='HZ_PARTIES'
and rel.object_type='ORGANIZATION'
and rel.subject_table_name='HZ_PARTIES'
and rel.subject_type='ORGANIZATION'
and rel.directional_flag in ('F','B')
and not exists ( select 1
from hz_relationships
where relationship_code in ( 'PARENT_OF' , 'HEADQUARTERS_OF' )
and subject_table_name='HZ_PARTIES'
and subject_type='ORGANIZATION'
and ( end_date is null
or end_date > sysdate )
and actual_content_source = 'DNB'
and subject_id=rel.subject_id );