提交 5fb1240b 编写于 作者: B BayoNet

DOCAPI-6206: ODBC engine and table function.

上级 0da7463a
......@@ -78,3 +78,5 @@ FROM jdbc_table
## See Also
- [JDBC table function](../../query_language/table_functions/jdbc.md).
[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/jdbc/) <!--hide-->
# ODBC
Allows ClickHouse to connect to external databases via [ODBC](https://en.wikipedia.org/wiki/Open_Database_Connectivity).
To implement ODBC connection, ClickHouse uses the separate program `clickhouse-odbc-bridge`. ClickHouse starts this program automatically when it is required. The ODBC bridge program is installed by the same package with the ClickHouse server.
This engine supports the [Nullable](../../data_types/nullable.md) data type.
## Creating a Table
```
CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = ODBC(connection_settings, external_database, external_table)
```
**Engine Parameters**
- `connection_settings` — Name of the sections with connection settings in the `odbc.ini` file.
- `external_database` — Database in an external DBMS.
- `external_table` — A name of the table in `external_database`.
## Usage Example
Some examples of how to use external dictionaries through ODBC you can find in the [ODBC](../../query_language/dicts/external_dicts_dict_sources.md#dicts-external_dicts_dict_sources-odbc) section of external dictionaries configuration.
## See Also
- [ODBC table function](../../query_language/table_functions/odbc.md).
[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/jdbc/) <!--hide-->
# jdbc
Returns table that is connected via ODBC driver.
```
odbc(connection_settings, external_database, external_table)
```
**Function Parameters**
- `connection_settings` — Name of the sections with connection settings in the `odbc.ini` file.
- `external_database` — Database in an external DBMS.
- `external_table` — A name of the table in `external_database`.
To implement ODBC connection, ClickHouse uses the separate program `clickhouse-odbc-bridge`. ClickHouse starts this program automatically when it is required. The ODBC bridge program is installed by the same package with the ClickHouse server.
This function supports the [Nullable](../../data_types/nullable.md) data type (based on DDL of remote table that is queried).
**Examples**
```
select * from odbc('DSN=connection_settings_name', 'external_database_name', 'external_table_name')
```
Some examples of how to use external dictionaries through ODBC you can find in the [ODBC](../../query_language/dicts/external_dicts_dict_sources.md#dicts-external_dicts_dict_sources-odbc) section of external dictionaries configuration.
[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/jdbc/) <!--hide-->
......@@ -96,7 +96,7 @@ nav:
- 'Memory': 'operations/table_engines/memory.md'
- 'Buffer': 'operations/table_engines/buffer.md'
- 'JDBC': 'operations/table_engines/jdbc.md'
- 'ODBC': 'operations/table_engines/odbc.md'
- 'SQL Reference':
- 'hidden': 'query_language/index.md'
- 'SELECT': 'query_language/select.md'
......@@ -149,6 +149,7 @@ nav:
- 'remote': 'query_language/table_functions/remote.md'
- 'url': 'query_language/table_functions/url.md'
- 'jdbc': 'query_language/table_functions/jdbc.md'
- 'odbc': 'query_language/table_functions/odbc.md'
- 'Dictionaries':
- 'Introduction': 'query_language/dicts/index.md'
- 'External Dictionaries':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册