Home | Previous Page | Next Page   Function Descriptions >

mi_get_default_database_info( )

The mi_get_default_database_info( ) function populates a database-information descriptor with the default database parameters.

Syntax

mi_integer mi_get_default_database_info(db_info)
   MI_DATABASE_INFO *db_info;
db_info
is a pointer to a user-allocated database-information descriptor in which to store the default database parameters.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The mi_get_default_database_info( ) function returns default database parameters into the database-information descriptor (MI_DATABASE_INFO structure) that db_info references. The database parameters include the name of the database, the user account, and the account password. The mi_open( ) function can use these default database parameters when it establishes a connection.

Tip:
You must allocate this database-information descriptor before you call mi_get_default_database_info( ).

If no default value exists for a particular field, the mi_get_default_database_info( ) function sets string fields to a NULL-valued pointer and integer fields to 0.

The mi_get_default_database_info( ) function also initializes the DataBlade API when it is the first DataBlade API function in a client LIBMI application or a user-defined routine.

Server Only

In a user-defined routine, mi_get_default_database_info( ) retrieves the same information as mi_get_database_info( ).

End of Server Only
Client Only

In a client LIBMI application, you can set the application database parameters with the mi_set_default_database_info( ) function.

End of Client Only

Return Values

MI_OK
indicates that the function was successful.
MI_ERROR
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_get_database_info( ), mi_open( ), and mi_set_default_database_info( ).

For more information on the database-information descriptor, more information on how to use the database-information descriptor, or more information on ways to interact with the session environment, see the IBM Informix: DataBlade API Programmer's Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]