Initialize the DataBlade API

Before you can use the DataBlade® API to communicate with the database server, you must make sure that it is initialized.

When you establish a connection, the DataBlade API function automatically initializes the DataBlade API. However, if your DataBlade API module does not establish a connection, it must still ensure that it initializes the DataBlade API.
Important: If the DataBlade API was not initialized, calls to subsequent DataBlade API functions generate errors.
The following table lists the functions that can initialize the DataBlade API.
Table 1. DataBlade API functions that initialize the DataBlade API
DataBlade API initialization function Valid in client LIBMI application? Valid in user-defined routine?
mi_client_locale() Yes Yes
mi_get_default_connection_info() Yes Yes
mi_get_default_database_info() Yes Yes
mi_get_next_sysname() Yes No
mi_get_parameter_info() Yes Yes
mi_init_library() Yes No
mi_open() Yes Yes
mi_register_callback() Yes Yes
mi_server_connect() Yes No
mi_set_default_connection_info() Yes Ignored
mi_set_default_database_info() Yes Ignored
mi_set_parameter_info() Yes No
mi_sysname() Yes Yes

One of the functions listed in the preceding table must be the first DataBlade API function called in a DataBlade API session. If you do not call one of these functions, the DataBlade API is not initialized and all subsequent DataBlade API calls return error status.