SQL-005: Provider address by location
This statement supports the clsProviderAddress retrieval path by reading provider-domain data from Oracle tables and projecting the result into business objects or DTO lists.
Classification
Field
Value
SQL ID
SQL-005
Operation type
Read
Execution method
Inline SQL
Database
Oracle
Schema
[unqualified]**
Command type
Text
Business object
clsProviderAddress
Criteria property
RetrieveSQL
Lifecycle method
Shared SQL constant reused by clsProviderAddressCollection.BeforeRetrieve
Parameters
Parameter
Direction
Type
Max length
Description
:ProviderLocationID
Input
Decimal
N/A
Required by the shared address SQL constant; bound when the same SQL is executed from the address collection retrieval path.
Tables
Table
Access
Columns used
PROVIDER_LOCATION
SELECT
PROVIDER_LOCATION_SEQ_NUM, PROVIDER_SEQ_NUM, PROVIDER_TYPE_CODE
PROVIDER_ADDRESS
SELECT
PROVIDER_LOCATION_SEQ_NUM, PROVIDER_ADDRESS_SEQ_NUM, PROVIDER_ADDRESS_CODE, CITY_NAME, STATE_CODE, ZIP_CODE
Sample SQL
SELECT
pa . provider_address_seq_num ,
pa . eff_date ,
pa . exp_date ,
ppl . business_name ,
NVL ( pa . address_line1 , ' ' ) AS address_line1 ,
pa . address_line2 ,
pa . address_line3 ,
pa . address_line4 ,
NVL ( pa . foreign_address_flag , 'N' ) AS foreign_address_flag ,
TRIM ( pa . city_name ) || ' ' || TRIM ( pa . state_code ) || ' ' || TRIM ( pa . ZIP_CODE )
|| DECODE ( pa . zip_code_ext , NULL , '' , '-' || pa . zip_code_ext ) AS addr_city_st ,
NVL (
ppl . TOLL_FREE_PHONE_NUM ,
NVL2 ( ppl . PHONE_AREA_CODE , '(' || ppl . PHONE_AREA_CODE || ') ' , '' )
|| NVL2 ( ppl . PHONE_NUM , SUBSTR ( ppl . phone_num , 1 , 3 ) || '-' || SUBSTR ( ppl . PHONE_NUM , - 4 ), '' )
|| NVL2 ( ppl . PHONE_NUM_EXT , 'x' || ppl . PHONE_NUM_EXT , '' )
) AS phone_num ,
NVL ( ppl . toll_free_fax_num , ppl . fax_num ) AS fax_num ,
NVL ( pa . PROVIDER_ADDRESS_CODE , ' ' ) AS PROVIDER_ADDRESS_CODE ,
NVL ( pa . CITY_NAME , ' ' ) AS CITY_NAME ,
pa . STATE_CODE ,
pa . ZIP_CODE ,
pa . ZIP_CODE_EXT ,
pa . COUNTRY_CODE ,
NVL ( ppl . BUSINESS_FLAG , 'N' ) AS BUSINESS_FLAG ,
pa . update_user AS UpdateUser ,
pa . update_date AS UpdateDate
FROM PROVIDER_LOCATION ppl
LEFT OUTER JOIN PROVIDER_ADDRESS pa
ON pa . provider_location_seq_num = ppl . provider_location_seq_num
WHERE ppl . provider_location_seq_num = : ProviderLocationID
Operations and processes
Note: Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources
Business\SAIF.Business.View.Provider\clsProviderAddress.vb