mysql_list_tables()

2023-07-26 02:37:19  Updated

You can call the mysql_list_tables() function to return a result set consisting of table names that match the simple regular expression specified by the wild argument.

Syntax

MYSQL_RES *
mysql_list_tables(MYSQL *mysql,
                  const char *wild)

wild may contain the % or _ wildcard characters, or may be a NULL pointer to match all tables.

Return values

A MYSQL_RES result set is returned for an execution success, and NULL is returned if an error occurred.

Errors

  • CR_COMMANDS_OUT_OF_SYNC: Commands were executed in an improper order.

  • CR_SERVER_GONE_ERROR: The connection to the OBServer was disconnected.

  • CR_SERVER_LOST: The connection to the server was lost during the query.

  • CR_UNKNOWN_ERROR: An unknown error occurred.

Notes

Calling mysql_list_tables() is similar to executing the query SHOW TABLES [LIKE wild].

After the call is completed, you must free the result set with mysql_free_result().

Contact Us