システム関数は、CData Virtuality Server システムの情報へのクエリによるアクセスを提供します。以下はその概要です:
To view the full table, click the expand button in its top right corner
Function | Description | Return value type |
---|---|---|
CALLER() | Retrieves the name of the user executing the query. For jobs: when For procedures: when | String |
| Retrieves the catalog name of the database | String |
| Returns a list of schemas (data sources and virtual schemas).
| String Array |
| Sets the indicated session variable to the indicated value | Object |
| Retrieves the value (null if no value has been set) | Object |
| Retrieves the system (i.e. CData Virtuality Server) property specified by | String |
| Retrieves current session ID in string form | String |
| Retrieves the current request ID | Long |
| Retrieves the name of the user owning the query | String |
| Retrieves the oldest materialization timestamp from all query components. fqn can be the fully qualified name of a table/view or column. Returns Example:
| Timestamp |
例えば、 USER()
を実行する方法です:
SELECT
USER
();;
USER()
and user()
will work.Special Note on ENV('key')
この機能について覚えておくべき重要なことの1つは、システムプロパティへの信頼できないアクセスを防止するためのセキュリティ上の理由から、デフォルトでは有効になっていないということです。有効にするには、以下のコマンドを使用し、CData Virtuality Server を再起動する必要があります:
CALL SYSADMIN.executeCli(
'/subsystem=teiid:write-attribute(name=allow-env-function,value=true)'
);;
Special Note on DV_SESSION_SET('name', value) and DV_SESSION_GET('name')
前述の他のシステム関数とは異なり、この2つは一緒になっており、その目的はセッション・レベルでの変数の設定と読み込みです。
最初の関数は、指示された変数に指示された値を設定し、古い値を返し、2番目は現在の値を取得します(以前に値が設定されていない場合は、 NULLが返されます)。変数はキーと値のペアで、名前は文字列、値と戻り値はオブジェクトです。
特別なケースとして、 dv.maxRecursion
セッション変数があります。これはセッション変数そのもので、固定されたデフォルト値を持ち、 DV_SESSION_SET('name', value)
を使って を変更することができます:
SELECT
DV_SESSION_SET(
'dv.maxRecursion'
, 25);;