Executing a script automatically on an UltraLite client

On UltraLite clients, scripts that are not marked as manual are run automatically the next time that the database is started, unless the connection parameter dont_run_scripts has been set.

Script execution progress can be provided during both manual and automatic execution if a progress observer callback has been provided, which is defined as follows:

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

The ul_sql_passthrough_status structure is defined as follows:

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;

The progress observer callback is registered via the following method:

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