Overview: This SQL query used to fetch Operating units GST Number such as registeration number, legal identity identifier, location code, operating unit short code in Oracle R12 Application.
SELECT ood.BUSINESS_GROUP_ID, ood.ORGANIZATION_ID, ood.name OU_NAME, short_code OU_SHORT_NAME, hrl.location_code LOCATION_CODE, jprl.REGISTRATION_NUMBER , ood.SET_OF_BOOKS_ID, LEGAL_ENTITY_IDENTIFIER ENTITY_CODE, xep.Name entity_name FROM hr_operating_units ood, xle_entity_profiles xep, jai_party_regs jpr, jai_party_reg_lines jprl, hr_locations hrl WHERE ood.default_legal_context_id = xep.legal_entity_id AND NVL (ood.DATE_TO, SYSDATE) >= SYSDATE AND xep.EFFECTIVE_TO IS NULL AND jpr.party_reg_id=jprl.party_reg_id and jpr.party_type_code='IO' and jpr.party_site_id=hrl.location_id and jpr.party_id=ood.organization_id and jprl.regime_id=10000