CData Virtuality Server は、さまざまな操作のためにいくつかのタイプの組み込みスカラー関数を提供します。ここではアルファベット順にご紹介します:

  • Aggregate functions グループから値のセットを受け取り、グループから計算された単一のスカラー値を返します。
  • Array functions は配列のさまざまな操作に使用されます。
  • Choice functions は2つの値から選択する方法を提供します。
  • Date and time functions 日付、時刻、または TIMESTAMP を返す、または操作します。
  • JSON functions  JSONデータを扱うための機能を提供します。
  • Numeric functions 数値または文字列を入力として受け取り、数値を返します。
  • Security functions セキュリティ・システムとの対話機能を提供します。
  • String functions 一般に、文字列を入力とし、文字列を出力として返します。
  • System functions  CData Virtuality Server システム内の情報へのクエリによるアクセスを提供します。
  • Type conversion functions クエリ内でのデータ型の変換を可能にします。
  • Window functions はAggregate 関数と似ていますが、 OVER  句またはWindow 指定を使用する必要があります。
  • XML functions  XML データを扱うための機能を提供します。

サポートされているビルドイン関数と関数パラメータは、SYS.FunctionsSYS.FunctionParams テーブルにあります。

Function Determinism

 CData Virtuality Server におけるスカラー関数の特徴は、決定性の度合いが異なることです。これは、関数の決定性の度合いによって、関数が評価されるタイミングや結果がキャッシュされる範囲が決まるため重要です。CData Virtuality Server には、5つの機能決定レベルがあります:

Level
Description
Functions

Deterministic 

  • The function will always return the same result for the given inputs;
  • Deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase;
  • Some functions are not truly deterministic but are treated as such for performance

All except listed below

User Deterministic

  • The function will return the same result for the given inputs for the same user;
  • User deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase;
  • If a user deterministic function is evaluated during the creation of a prepared processing plan, then the resulting plan will be cached only for the user

HASCALLERROLE

CALLER

Session Deterministic

  • The function will return the same result for the given inputs under the same user session;
  • Session deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase;
  • If a session deterministic function is evaluated during the creation of a prepared processing plan, then the resulting plan will be cached only for the user's session

ENV

Command Deterministic

  • The result of function evaluation is only deterministic within the scope of the user command;
  • Command deterministic functions are delayed in evaluation until processing to ensure that even prepared plans utilizing these functions will be executed with relevant values;
  • Command deterministic function evaluation will occur before pushdown - however, multiple occurrences of the same command deterministic time function are not guaranteed to evaluate to the same value

CURDATE

CURTIME

NOW

Nondeterministic

  • The result of function evaluation is fully nondeterministic;
  • Nondeterministic functions are delayed in evaluation until processing with a preference for pushdown;
  • If the function is not pushed down, then it may be evaluated for every row in its execution context (for example, if the function is used in the SELECT clause)

RAND

HASROLE

USER