DOCAPI-6206: ODBC engine and table function.

This commit is contained in:
BayoNet 2019-05-15 13:44:55 +03:00
parent 0da7463a6b
commit 5fb1240bf6
4 changed files with 60 additions and 1 deletions

View File

@ -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-->

View File

@ -0,0 +1,29 @@
# 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-->

View File

@ -0,0 +1,27 @@
# 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-->

View File

@ -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':