SELECT fnd_lookup_values_vl.attribute1, fnd_lookup_values_vl.attribute2,
fnd_lookup_values_vl.attribute3, fnd_lookup_values_vl.attribute4,
fnd_lookup_values_vl.lookup_type, fnd_lookup_values_vl.lookup_code,
fnd_lookup_values_vl.enabled_flag,
fnd_lookup_values_vl.start_date_active,
fnd_lookup_values_vl.end_date_active,
fnd_lookup_values_vl.last_updated_by,
fnd_lookup_values_vl.last_update_login,
fnd_lookup_values_vl.last_update_date,
fnd_lookup_values_vl.security_group_id,
fnd_lookup_values_vl.view_application_id, fnd_lookup_values_vl.tag,
fnd_lookup_values_vl.meaning, fnd_lookup_values_vl.description,
hz_trans_attributes_vl.attribute_id,
hz_trans_attributes_vl.entity_name,
hz_trans_attributes_vl.attribute_name,
hz_trans_attributes_vl.user_defined_attribute_name,
hz_trans_attributes_vl.custom_attribute_procedure,
hz_trans_attributes_vl.source_table, hz_trans_attributes_vl.created_by,
hz_trans_attributes_vl.creation_date,
hz_trans_attributes_vl.object_version_number,
hz_trans_attributes_vl.denorm_flag
FROM hz_trans_attributes_vl, fnd_lookup_values_vl
WHERE UPPER (fnd_lookup_values_vl.lookup_type) =
UPPER (DECODE (hz_trans_attributes_vl.entity_name,
'PARTY', 'PARTY_LOGICAL_ATTRIBUTE_LIST',
'PARTY_SITES', 'PARTY_SITE_LOGICAL_ATTRIB_LIST',
'CONTACTS', 'CONTACT_LOGICAL_ATTRIB_LIST',
'CONTACT_POINTS', 'CONTACT_PT_LOGICAL_ATTRIB_LIST'
)
)
AND fnd_lookup_values_vl.lookup_code =
hz_trans_attributes_vl.attribute_name