SELECT 'Operating_Unit' profile_type, cp.credit_profile_id,
cp.organization_id, TO_NUMBER (NULL) item_category_id,
cp.creation_date, cp.created_by, cp.last_update_date,
cp.last_updated_by, cp.last_update_login, cp.program_application_id,
cp.program_id, cp.program_update_date, cp.request_id, cp.enable_flag,
cp.effective_date_from, cp.effective_date_to, cp.credit_checking,
cp.next_credit_review_date, cp.tolerance, cp.credit_hold,
cp.credit_rating, cp.attribute_category, cp.attribute1, cp.attribute2,
cp.attribute3, cp.attribute4, cp.attribute5, cp.attribute6,
cp.attribute7, cp.attribute8, cp.attribute9, cp.attribute10,
cp.attribute11, cp.attribute12, cp.attribute13, cp.attribute14,
cp.attribute15
FROM hz_credit_profiles cp
WHERE item_category_id IS NULL
UNION
SELECT 'Item_Category' profile_type, cp.credit_profile_id,
TO_NUMBER (NULL) organization_id, cp.item_category_id,
cp.creation_date, cp.created_by, cp.last_update_date,
cp.last_updated_by, cp.last_update_login, cp.program_application_id,
cp.program_id, cp.program_update_date, cp.request_id, cp.enable_flag,
cp.effective_date_from, cp.effective_date_to, cp.credit_checking,
cp.next_credit_review_date, cp.tolerance, cp.credit_hold,
cp.credit_rating, cp.attribute_category, cp.attribute1, cp.attribute2,
cp.attribute3, cp.attribute4, cp.attribute5, cp.attribute6,
cp.attribute7, cp.attribute8, cp.attribute9, cp.attribute10,
cp.attribute11, cp.attribute12, cp.attribute13, cp.attribute14,
cp.attribute15
FROM hz_credit_profiles cp
WHERE organization_id IS NULL