location

The location of a resource or event.

The location can be as specific, such as a room in a factory or general, such as a mine site.

The fields in the location table are listed in the following table.

Table 1. Fields in the location table
Field Type Comments
location_cd string(50) Required
location_name string(200) Required
region_cd string(50) Optional. The region_cd and region_name parameters must be supplied together.
region_name string(200) Optional
country_cd string(50) Optional. The country_cd and country_name parameters must be supplied together.
country_name string(200) Optional
state_province_cd string(50) Optional. The state_province_cd and state_province_name parameters must be supplied together.
state_province_name string(200) Optional
city_name string(200) Optional
latitude decimal (in signed decimal degrees. N is + and S is -) Optional
longitude decimal (in signed decimal degrees. E is + and W is -) Optional
language_cd string(50) Optional. This value must reference a row in the language table.
tenant_cd string(50) Optional. This value must reference a row in the tenant table.
IS_ACTIVE 0 or 1 Optional. A value of 0 indicates that the record is inactive. No value, or a value of 1, indicates that the record is active.

location code snippet

You can use the following SQL Code snippet to retrieve master data in the format that is required by the upsert API.

For example, if you lost the original files that are used to load master data, you can use the snippet to retrieve the data, make changes, and submit the changes by using the upsert API.

The command must be on a single line, not as shown here.

SELECT M.LOCATION_CD, M.LOCATION_NAME, M.REGION_CD, M.REGION_NAME, M.COUNTRY_CD,
 M.COUNTRY_NAME, M.STATE_PROVINCE_CD, M.STATE_PROVINCE_NAME, M.CITY_NAME, 
M.LATITUDE, M.LONGITUDE, L.LANGUAGE_CD, T.TENANT_CD, M.ISACTIVE FROM 
SYSREC.MASTER_LOCATION M JOIN SYSREC.LANGUAGE L ON M.LANGUAGE_ID = 
L.LANGUAGE_ID JOIN SYSREC.TENANT T ON M.TENANT_ID = T.TENANT_ID;