util_address_retrieve() returns the full address details based on the ID. The function requires two arguments.
Pay attention that your Loqate account has to be a partner of the Querix Loqate account.
Syntax
CALL util_address_search(license_key STRING, address_id STRING) RETURNING util_address_retrieve_output
util_address_retrieve_output see definitions below
Usage example
DEFINE ret_l_arr_rec_addr OF util_address_retrieve_output DEFINE key, id STRING LET key = "FFFF-FFFF-FFFF-FFFF" LET id = "US|US|A|Y226166605|M308" CALL util_address_retrieve(key, id) RETURNING ret_l_arr_rec_addr
"FFFF-FFFF-FFFF-FFFF" is not a valid license key. It has been mentioned only for the example.
Instead, you should specify your own license key that can be found in your Loqate account.
Definitions
DEFINE util_address_retrieve_output TYPE AS RECORD
id STRING, # The unique Id of the address
domesticId STRING, # The unique Id of the address as it appears in its respective dataset
language STRING, # The language of the address
languageAlternatives STRING, # Alternative languages for the address
Department STRING, # Department name
Company STRING, # Company name
SubBuilding STRING, # The name of the sub building (e.g. flat, unit)
BuildingNumber STRING, # The number of building
BuildingName STRING, # The associated name of the building
SecondaryStreet STRING, # The secondary thoroughfare name. Usually a small street off the primary
Street STRING, # The main thoroughfare name
Block STRING, # The block details for the address
Neighbourhood STRING, # The neighbourhood the address is in
District STRING, # District name
City STRING, # City name
Line1 STRING, # The first line of the formatted address
Line2 STRING, # The second line of the formatted address
Line3 STRING, # The third line of the formatted address
Line4 STRING, # The fourth line of the formatted address
Line5 STRING, # The fifth line of the formatted address
AdminAreaName STRING, # The name of the administrative area for the address
AdminAreaCode STRING, # The code of the administrative area for the address
Province STRING, # Province / county
ProvinceName STRING, # Province / county
ProvinceCode STRING, # Associated province code
PostalCode STRING, # Postal code
CountryName STRING, # Name of the country the address is in
CountryIso2 STRING, # 2 character ISO code for the country
CountryIso3 STRING, # 3 character ISO code for the country
CountryIsoNumber STRING, # ISO numeric code for the country
SortingNumber1 STRING, #
SortingNumber2 STRING, #
Barcode STRING, # The barcode for the addres - needs to be used with an appropriate barcode font
POBoxNumber STRING, # PO Box number
Label STRING, # The full address formatted as a label
type STRING, # The type of address if known
DataLevel STRING, # The data level if known - depends on the data set the address originates from
Field1 STRING, # The data from the field requested to appear here, otherwise blank. Similar for all FieldX responses
Field2 STRING, #
Field3 STRING, #
Field4 STRING, #
Field5 STRING, #
Field6 STRING, #
Field7 STRING, #
Field8 STRING, #
Field9 STRING, #
Field10 STRING, #
Field11 STRING, #
Field12 STRING, #
Field13 STRING, #
Field14 STRING, #
Field15 STRING, #
Field16 STRING, #
Field17 STRING, #
Field18 STRING, #
Field19 STRING, #
Field20 STRING #
END RECORD
Exception handling
While working with Loqate web service the following errors may occur:
If one of the errors above occurs, the application automatically stops. To continue work with the application, despite the occurred error, the following exception handling is required:
WHENEVER ERROR CONTINUE
CALL util_address_retrieve(...)
WHENEVER ERROR STOP
IF status THEN
...handle exception...
END IF