> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ext_table table

> This table contains entries used for mapping an external table to an internal table (customer or cust_company) for database integration.

## ext\_table Table (318)

This table contains entries used for mapping an external table to an internal table (customer or cust\_company) for database integration.

## Fields

| Name                 | Description                                                       | Type                                       | Nullable |
| -------------------- | ----------------------------------------------------------------- | ------------------------------------------ | :------: |
| id                   | The primary key (auto-incremented)                                | PK                                         |    No    |
| ext\_datasource      | The reference to the associated datasource.                       | FK [ext\_datasource](./ext-datasource.mdx) |    Yes   |
| parent\_table        | The reference to the parent table.                                | FK [ext\_table](./ext-table.mdx)           |    Yes   |
| child\_table         | The reference to the child table.                                 | FK [ext\_table](./ext-table.mdx)           |    Yes   |
| name                 | The name for this field                                           | String(64)                                 |    Yes   |
| target               | Enum indicating the target table (customer or cust\_company).     | Int                                        |    Yes   |
| priority             | TODO: depreciated?                                                | Int                                        |    Yes   |
| ldap\_search\_base2  | LDAP search base, multiple search bases are seperated by new line | Clob                                       |    Yes   |
| ldap\_search\_filter | LDAP search query                                                 | String(255)                                |    Yes   |
| ldap\_search\_result | Select which data to return from LDAP                             | String(255)                                |    Yes   |
| sql\_query           | The SQL query used for fetching the external data.                | Clob                                       |    Yes   |
| sql\_query2          | The SQL query used for fetching the external data. Part 2         | Clob                                       |    Yes   |
| primary\_key         | The name of the primary key. TODO: depreciated?                   | String(64)                                 |    Yes   |
| sql\_limit           | Used for LIMIT optimiziation of the search query                  | Int                                        |    Yes   |

<img src="https://mintcdn.com/superofficeas/6OcOTPa_ISkjXJg4/media/loc/en/database/tables/ext_table.png?fit=max&auto=format&n=6OcOTPa_ISkjXJg4&q=85&s=83d8e0b729e6eb726c52b1f2c49f56e0" alt="ext_table table relationship diagram" width="671" height="59" data-path="media/loc/en/database/tables/ext_table.png" />

## Indexes

| Fields          | Types | Description |
| --------------- | ----- | ----------- |
| ext\_datasource | FK    | Index       |
| parent\_table   | FK    | Index       |
| child\_table    | FK    | Index       |

## Relationships

| Table                               | Description                                                                                                                               |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [ext\_datasource](./ext-datasource) | This table contains external datasources, used for databaseintegration of customers and companies.                                        |
| [ext\_field](./ext-field)           | This table contains entries mapping an external field to an internal field. Used for database integration.                                |
| [ext\_table](./ext-table)           | This table contains entries used for mapping an external table to an internal table (customer or cust\_company) for database integration. |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [ext_field table](/en/database/tables/ext-field.md)
- [ext_datasource table](/en/database/tables/ext-datasource.md)
- [Look up customers](/en/automation/crmscript/howto/contact/find-customer.md)
- [extra_tables table](/en/database/tables/extra-tables.md)
- [extra_tables_result table](/en/database/tables/extra-tables-result.md)
- [extra_tables_entry table](/en/database/tables/extra-tables-entry.md)
