Documentation Home
MySQL 9.4 C API Developer Guide
Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


5.4.79 mysql_set_server_option()

intmysql_set_server_option(MYSQL *mysql, enum                        enum_mysql_set_option option)

Description

Enables or disables an option for the connection.option can have one of the following values.

OptionDescription
MYSQL_OPTION_MULTI_STATEMENTS_ONEnable multiple-statement support
MYSQL_OPTION_MULTI_STATEMENTS_OFFDisable multiple-statement support

If you enable multiple-statement support, you should retrieve results from calls tomysql_real_query() ormysql_query() by using a loop that callsmysql_next_result() to determine whether there are more results. For an example, seeSection 3.6.3, “Multiple Statement Execution Support”.

Enabling multiple-statement support withMYSQL_OPTION_MULTI_STATEMENTS_ON does not have quite the same effect as enabling it by passing theCLIENT_MULTI_STATEMENTS flag tomysql_real_connect():CLIENT_MULTI_STATEMENTS also enablesCLIENT_MULTI_RESULTS. If you are using theCALL SQL statement in your programs, multiple-result support must be enabled; this means thatMYSQL_OPTION_MULTI_STATEMENTS_ON by itself is insufficient to permit the use ofCALL.

Return Values

Zero for success. Nonzero if an error occurred.

Errors