Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (日本語) » Mobile Link - クライアント管理 » Mobile Link クライアントの紹介 » SQL パススルー » SQL パススルーの概要 » スクリプトの実行

 

Ultra Light クライアントでスクリプトを自動的に実行

Ultra Light クライアントでは、manual とマーク付けされていないスクリプトは、データベースの次回起動時に自動的に実行されます。ただし、接続パラメータ dont_run_scripts が設定されている場合は実行されません。

進行状況 observer コールバックが指定されている場合、手動実行と自動実行のどちらのときも、スクリプト実行の進行状況を提供できます。進行状況 observer コールバックは、次のように定義されます。

typedef void(UL_CALLBACK_FN *ul_sql_passthrough_observer_fn)
    ( ul_sql_passthrough_status * status );

ul_sql_passthrough_status 構造体は、次のように定義されます。

typedef struct {
    ul_sql_passthrough_state    state; // current state
    ul_u_long  script_count; // total number of scripts to execute
    ul_u_long  cur_script; // current script being executed (1-based)
    ul_bool  stop;  // set to true to stop script execution
         // can only be set in the starting state
    ul_void *  user_data; // user data provided in register call
    SQLCA *  sqlca;
} ul_sql_passthrough_status;

進行状況 observer コールバックは、次のメソッドによって登録されます。

UL_FN_SPEC ul_ret_void UL_FN_MOD ULRegisterSQLPassthroughCallback(
SQLCA *                             sqlca,
ul_sql_passthrough_observer_fn      callback,
ul_void *                           user_data );