Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
指定した名前でユーザ定義変数が作成または定義されている場合は 1 を返します。該当する変数が作成されていない場合は、0 を返します。
VAREXISTS( variable-name-string )
variable-name-string 文字列としてテストされる変数名。
INT
SQL/2008 ベンダー拡張。
変数が作成または宣言されていない場合、次の IF 文は、start_time という名前の変数を作成します。作成された変数は安全に使用できます。
IF VAREXISTS( 'start_time' ) = 0 THEN CREATE VARIABLE start_time TIMESTAMP; END IF; SET start_time = current timestamp;