The mi_get_dbnames() function
The mi_get_dbnames() function retrieves the names of all databases available on the database server, corresponding to the logged-in connection.
Syntax
mi_integer mi_get_dbnames(conn, dbnameps, dbnamepssize, dbnamesb, dbnamesbsize)
MI_CONNECTION *conn;
char *dbnameps[];
mi_integer dbnamepssize;
char *dbnamesb;
mi_integer dbnamesbsize;
- conn
- A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().
- dbnameps
- contains pointers to database names.
- dbnamepssize
- The size of dbnameps.
- dbnamesb
- A pointer to the result list of database names.
- dbnamesbsize
- The size of dbnamesb.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | No |
Usage
The mi_get_dbnames() function copies database names into dbnamesb (up to dbnamesbsize) and copies database-name pointers into dbnameps (up to dbnamepssize). The user allocates dbnamesb and dbnameps.
If the connection is not logged in, this function retrieves the names of databases available on $INFORMIXSERVER. If the connection is not provided (conn argument is NULL), this function retrieves the names of databases on all database servers.
Return values
- >=0
- The number of retrieved database names.
- MI_ERROR
- The function was not successful.