CData Virtuality Server では、特定のコネクタを使用してさまざまなデータソースをクエリできます。このページでは、専用のストアドプロシージャの構文とパラメータの一覧を示します。ストアドプロシージャの使用に関する一般的な情報については、Connecting Data Sourcesの章を参照してください。

SYSADMIN.createConnection

このプロシージャは接続を作成します:

SYSADMIN.createConnection(IN name string, IN jbossCLITemplateName string, IN connectionOrResourceAdapterProperties string, IN encryptedProperties string)

以下のパラメータを取ります:

Parameter

Description

name

Name of the new connection

jbossCLITemplateName

Name of the CLI template used

connectionOrResourceAdapterProperties

Properties of the new connection, optional

encryptedProperties

Encrypted properties; optional

実際のJNDI名は、与えられた名前とCLIテンプレート名をマイナス記号で結合したものになります(template-nameのように)。

SYSADMIN.importConnection

このプロシージャは、接続が確立できなくても失敗しない接続をインポートします:

SYSADMIN.importConnection(IN name string, IN jbossCLITemplateName string, IN connectionOrResourceAdapterProperties string, IN encryptedProperties string)

以下のパラメータを取ります:

Parameter

Description

name

Name of the imported connection

jbossCLITemplateName

Name of the CLI template used

connectionOrResourceAdapterProperties

Properties of the new connection; optional

encryptedProperties

Encrypted properties; optional

実際のJNDI名は、与えられた名前とCLIテンプレート名をマイナス記号で結合したものになります(template-nameのように)。

SYSADMIN.removeConnection

このプロシージャは接続を削除します:

SYSADMIN.removeConnection(IN name string)

name削除する接続のパラメータを1つ受け取ります。

SYSADMIN.createDataSource

このプロシージャはデータソースを作成します:

SYSADMIN.createDataSource(IN name string, IN translator string, IN modelProperties string, IN translatorProperties string, encryptedModelProperties string, encryptedTranslatorProperties string)

以下のパラメータを取ります:

Parameter

Description

name

Name of the new data source

translator

Name of translator

modelProperties

Model properties; optional

translatorProperties

Translator properties; optional

encryptedModelProperties

Encrypted model properties; optional

encryptedTranslatorProperties

Encrypted translator properties; optional

If the data source is based on a modular connector, the modular connector should be deployed via the SYSADMIN.deployModularConnector procedure before creating the data source. Please refer to Modular Connectors Management for more details.

SYSADMIN.createOrReplaceDatasource

このプロシージャでは、データソースまたは接続パラメータのいずれかが既存のデータソースまたは接続定義と異なる場合に、データソースを不足している接続とともに作成するか、既存のデータソースを置き換えます:

SYSADMIN.createOrReplaceDatasource(IN name string, IN translator string, IN modelProperties string, IN translatorProperties string, IN encryptedModelProperties string, IN encryptedTranslatorProperties string, IN connectionTemplateName string, IN connectionProperties string, IN connectionEncryptedProperties string, IN enableReplace boolean DEFAULT 'false')

以下のパラメータを取ります:

Parameter

Description

name

Name of the data source and its connection

translator

Name of translator

modelProperties

Model properties; optional

translatorProperties

Translator properties; optional

encryptedModelProperties

Encrypted model properties; optional

encryptedTranslatorProperties

Encrypted translator properties; optional

connectionTemplateName

Name of the CLI template used

connectionProperties

Properties of the connection; optional

connectionEncryptedProperties

Encrypted properties; optional

enableReplace

If set to TRUE, the procedure will try to replace an existing data source and connection with the same name if any of the parameters differ from the existing definition

If the data source is based on a modular connector, the modular connector should be deployed via the SYSADMIN.deployModularConnector procedure before creating the data source. Please refer to Modular Connectors Management for more details.

SYSADMIN.importDataSource

このプロシージャはデータソースをインポートします:

SYSADMIN.importDataSource(IN name string, IN translator string, IN modelProperties string, IN translatorProperties string, encryptedModelProperties string, encryptedTranslatorProperties string)

以下のパラメータを取ります:

Parameter

Description

name

Name of the imported data source

translator

Name of translator

modelProperties

Model properties; optional

translatorProperties

Translator properties; optional

encryptedModelProperties

Encrypted model properties; optional

encryptedTranslatorProperties

Encrypted translator properties; optional

If the data source is based on a modular connector, the respective modular connector should be deployed via the SYSADMIN.deployModularConnector procedure before importing the data source. Please refer to Modular Connectors Management for more details.

SYSADMIN.recreateConnection

このプロシージャは、指定された接続を削除し、格納されているテンプレート名とプロパティを使用して再作成します:

SYSADMIN.recreateConnection(IN name string)

SYSADMIN.removeDataSource

このプロシージャは、指定されたデータソースを削除します:

SYSADMIN.removeDataSource(IN name string)

SYSADMIN.refreshTables

このプロシージャは、テーブルをリフレッシュします:

SYSADMIN.refreshTables(IN schemaName string NOT NULL, IN tableNamePattern string NOT NULL)

指定されたパターン(LIKE句のようなSQL パターン)で選択されたテーブルをリフレッシュします。

tableNamePattern の値は大文字と小文字を区別します。

SYSADMIN.refreshTables procedure available since v4.10

SYSADMIN.refreshDataSource

このプロシージャは、指定されたデータソースを更新します:

SYSADMIN.refreshDataSource(IN name string, OUT reply integer NOT NULL RESULT)

プロシージャは、次のいずれかの戻り値を持つことができます:

Return value

Description

-1

Value returned when refreshing a virtual or system schema (VIEWS, SYS, SYSADMIN, PG_CATALOG, UTILS, SYSADMIN_VDB, SYSLOG, and INFORMATION_SCHEMA)

1

Everything is OK

0

The procedure has already been called by someone else

SYSADMIN.refreshTables and SYSADMIN.refreshDataSource Parallel Calls Behaviour

SYSADMIN.refreshTables Calls

同じデータソースからのテーブルまたはパターンに対するSYSADMIN.refreshTables の呼び出しはキューに入れられ、呼び出された順に実行されます。このメカニズムは、呼び出しが順番に処理されるようにすることで、同時実行の問題を防ぎます。

Combined SYSADMIN.refreshDataSource with SYSADMIN.refreshTables Calls

SYSADMIN.refreshDataSource呼び出しがSYSADMIN.refreshTablesと組み合わされると、それらはキューに入れられ、同じ順序で実行されます。

Multiple SYSADMIN.refreshDataSource Calls

同じデータソースに対する2つ以上のSYSADMIN.refreshDataSource呼び出しが、SYSADMIN.refreshTables呼び出しを挟まずに発生した場合:

  • 最初のクエリだけが実行されます;
  • それ以降の呼び出しは、最初のクエリが完了するまで待機し、完了すると最初のクエリと同じステータスを受け取ります。

SYSADMIN.refreshSchema

このプロシージャは、物理または仮想の指定されたスキーマをリフレッシュします:

SYSADMIN.refreshSchema(IN name string)

SYSADMIN.refreshAllDataSources

このプロシージャはすべてのデータソースをリフレッシュします:

SYSADMIN.refreshAllDataSources()

SYSADMIN.refreshAllSchemas

このプロシージャはすべてのスキーマをリフレッシュします:

SYSADMIN.refreshAllSchemas()

SYSADMIN.testConnection

このプロシージャは、指定されたプロパティとの接続をチェックします:

SYSADMIN.testConnection(IN jbossCLITemplateName string, IN connectionOrResourceAdapterProperties string, IN translator string, IN translatorProperties string, IN encryptedProperties string, IN encryptedTranslatorProperties string)

encryptedProperties and encryptedTranslatorProperties properties of SYSADMIN.testConnection are available since v4.4

SYSADMIN.getDataSourceMetadataDiff

このプロシージャは、指定されたデータソースのメタデータの差分を返します:

SYSADMIN.getDataSourceMetadataDiff(IN name string)

SYSADMIN.getAllDataSourcesMetadataDiff

このプロシージャは、すべてのデータソースのメタデータの差分を返します:

SYSADMIN.getAllDataSourcesMetadataDiff()

SYSADMIN.getCatalogs

このプロシージャは、データソースカタログのリストを返します:

SYSADMIN.getCatalogs"("connectionName" => 'connection_name')

接続名という1つのパラメータを受け取り、データソースの作成に使用できる値を返します:

Database

Returned values

Additional Information

BigQuery

projectId

Connection without a projectId cannot be created

PostgreSQL

database list


Redshift

database list


Snowflake

database list


SQL Server

database list


SYSADMIN.getSchemas

このプロシージャは、データソース スキーマのリストを返します:

SYSADMIN.getSchemas"("connectionName" => 'connection_name')

接続名という1つのパラメータを受け取り、データソースの作成に使用できる値を返します:

Database

Returned values

Additional Information

BigQuery

Schemas within a project

Connection without a projectId cannot be created

Oracle

Namespace within a database

Connection without a database cannot be created

PostgreSQL

Schemas within a database

Without specifying a database, PostgreSQL only lists system schemas and the default one (public) for the default database (postgres)

Redshift

Schemas within a database

Redshift cannot list schemas without specifying a database

Snowflake

Schema list per database

Lists all schemas if the db property is not specified in the connection. If it is specified, only schemas within this database are listed

SQL Server

Schema list per database

All schemas are listed regardless of a database being specified 

SYSADMIN.getDataSourcePropertiesHierarchy

このプロシージャは、CData ドライバーのプロパティ階層をJSON 形式で返します。 デフォルトコンテキストは _datahubh です。

SYSADMIN.getDataSourcePropertiesHierarchy(IN driverName string NOT NULL, IN context string, OUT hierarchy string)

Mandatory Parameters

このプロシージャには以下の必須パラメータがあります:

Parameter

Description

driverName

The name of the driver


SYSADMIN.getDataSourcePropertiesHierarchy available since v4.6

Connection Properties Validation

接続のプロパティは、接続が作成、編集、削除、およびテストされるときに、CLI テンプレートに対して検証されます。CLI テンプレートに存在しない接続パラメータは受け付けられません。