CREATE-RESOURCE
Last Updated:2021-11-03
CREATE RESOURCE
Description
Used to create a resource. Resources can be cited by other processes.
Currently the following resource types are supported:
-
ODBC
CREATE EXTERNAL RESOURCE `resource_name` [PROPERTIES]
-
PROPERTIES
is used to set ODBC connection information.type
:resource type. Fixed content:odbc_catalog
.host/port
:target of data source connection.user/password
:username and password for connecting data source.-
database/table
:Database and table names in the data source.When citing resources in CREATE ODBC TABLE, the information here can be covered by specifying the database and table names.
odbc_type
:ODBC type, supporting:oracle
,mysql
andpostgresql
.driver
: ODBC Driver name. The public cloud users support:Oracle
,MySQL
andPostgreSQL
.
-
Example
-
Create an ODBC resource for connecting MySQL database.
CREATE EXTERNAL RESOURCE `mysql_odbc_resource` PROPERTIES ( "type" = "odbc_catalog", "host" = "192.168.0.1", "port" = "8086", "user" = "test", "password" = "test", "database" = "test", "table" = "test", "odbc_type" = "mysql", "driver" = "MySQL" );
-
Create an ODBC resource for connecting Oracle database.
CREATE EXTERNAL RESOURCE `oracle_odbc` PROPERTIES ( "type" = "odbc_catalog", "host" = "192.168.0.1", "port" = "8086", "user" = "test", "password" = "test", "odbc_type" = "oracle", "driver" = "Oracle" );
Keywords
CREATE, RESOURCE