tables · table
location
The location table serves as a master directory for physical and logical sites within the enterprise. It stores detailed geographic information (address, city, state), contact details (email, phone), and organizational metadata (Department, ChildLocation flag).
Row count
20
Last entry
—
Source
tables
Columns
14| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | integer | No | Internal primary key/row index |
compcode | string | No | Company unique identifier |
location | string | No | The primary name/ID of the location |
locaddress | string | Yes | Primary street address |
loccode | string | Yes | Internal alphanumeric code for the location |
Department | string | Yes | Associated organizational department |
locaddress2 | string | Yes | Secondary address line |
locaddress3 | string | Yes | Tertiary address line |
locPIN | string | Yes | Postal/Zip code |
city | string | Yes | City name |
statecode | string | Yes | State/Province code |
ChildLocation | string | Yes | Flag indicating if this is a sub-location |
email | string | Yes | Contact email for the site |
phoneco | string | Yes | Contact phone number for the site |
Full documentation
### 1. Overview The `location` table serves as a master directory for physical and logical sites within the enterprise. It stores detailed geographic information (address, city, state), contact details (email, phone), and organizational metadata (Department, ChildLocation flag). This table is critical for multi-site operations, as it is referenced by nearly every major module—including Sales (`invhdr`), Purchasing (`cpohdr`), Production (`jobhdr`), and Human Resources (`empmas`)—to specify where goods are stored, where production occurs, or where employees are stationed. ### 2. Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | integer | No | Internal primary key/row index | | Primary Key | | **compcode** | string | No | Company unique identifier | e.g., "DAS" | FK to `dbo.Company` | | **location** | string | No | The primary name/ID of the location | e.g., "1st floor", "BOP" | Main Join Key | | **locaddress** | string | Yes | Primary street address | | Reporting | | **loccode** | string | Yes | Internal alphanumeric code for the location | | Join Key (Likely) | | **Department** | string | Yes | Associated organizational department | | Filtering | | **locaddress2** | string | Yes | Secondary address line | | Reporting | | **locaddress3** | string | Yes | Tertiary address line | | Reporting | | **locPIN** | string | Yes | Postal/Zip code | | Logistics | | **city** | string | Yes | City name | | Filtering/Logistics | | **statecode** | string | Yes | State/Province code | | FK to `dbo.Statemas` | | **ChildLocation** | string | Yes | Flag indicating if this is a sub-location | "Y", "N" | Hierarchy | | **email** | string | Yes | Contact email for the site | | Notifications | | **phoneco** | string | Yes | Contact phone number for the site | | Reporting | ### 3. Relationships & Join Map #### Logical Joins (Primary) * **Transactional Headers:** Joins to `dbo.invhdr`, `dbo.cpohdr`, `dbo.jobhdr`, `dbo.fghdr`, and `dbo.rmincoming` via `(location, compcode)` to attribute transactions to a specific site. * **Production & Inventory:** Joins to `dbo.itemmas` and `dbo.job` via `(location, compcode)` to define the default storage or processing site for specific items. * **Physical Tracking:** Joins to `dbo.PhyLocation` via `(location, CompCode)` for granular bin/shelf tracking within a site. #### Strict Join Map (SCHEMA_MAP Verified) | Target Table | Join Column | Join Type | Context | | :--- | :--- | :--- | :--- | | `dbo.Statemas` | `statecode` | Many-to-One | Geographic lookup for state names. | | `dbo.invhdr` | `location`, `compcode` | One-to-Many | Identifying the dispatch/storage location of an invoice. | | `dbo.cpohdr` | `location`, `compcode` | One-to-Many | Identifying the delivery location for Purchase Orders. | | `dbo.jobhdr` | `location`, `compcode` | One-to-Many | Identifying the site responsible for a production job. | | `dbo.empmas` | `location`, `compcode` | One-to-Many | Linking employees to their assigned work location. | | `dbo.machine` | `location`, `compcode` | One-to-Many | Identifying the physical location of plant machinery. | | `dbo.PhyLocation` | `location`, `compcode` | One-to-Many | Mapping logical locations to physical warehouse slots. |