C API Prepared Statement Function Descriptions
2220
bind[0].length= &length;
bind[0].is_null= 0;
/* Bind the buffers */
if (mysql_stmt_bind_param(stmt, bind))
{
fprintf(stderr, "\n param bind failed");
fprintf(stderr, "\n %s", mysql_stmt_error(stmt));
exit(0);
}
/* Supply data in chunks to server */
if (mysql_stmt_send_long_data(stmt,0,"MySQL",5))
{
fprintf(stderr, "\n send_long_data failed");
fprintf(stderr, "\n %s", mysql_stmt_error(stmt));
exit(0);
}
/* Supply the next piece of data */
if (mysql_stmt_send_long_data(stmt,0,
" - The most popular Open Source database",40))
{
fprintf(stderr, "\n send_long_data failed");
fprintf(stderr, "\n %s", mysql_stmt_error(stmt));
exit(0);
}
/* Now, execute the query */
if (mysql_stmt_execute(stmt))
{
fprintf(stderr, "\n mysql_stmt_execute failed");
fprintf(stderr, "\n %s", mysql_stmt_error(stmt));
exit(0);
}
20.6.10.26.
mysql_stmt_sqlstate()
const char *mysql_stmt_sqlstate(MYSQL_STMT *stmt)
Description
For the statement specified by
stmt
,
mysql_stmt_sqlstate()
returns a null-terminated string
containing the SQLSTATE error code for the most recently invoked prepared statement API function
that can succeed or fail. The error code consists of five characters.
"00000"
means “no error.” The
values are specified by ANSI SQL and ODBC. For a list of possible values, see
Appendix C, Errors,
Error Codes, and Common Problems
.
Note that not all MySQL errors are yet mapped to SQLSTATE codes. The value
"HY000"
(general
error) is used for unmapped errors.
Return Values
A null-terminated character string containing the SQLSTATE error code.
20.6.10.27.
mysql_stmt_store_result()
int mysql_stmt_store_result(MYSQL_STMT *stmt)
Description
Result sets are produced by calling
mysql_stmt_execute()
to executed prepared
statements for SQL statements such as
SELECT
,
SHOW
,
DESCRIBE
, and
EXPLAIN
. By default,
result sets for successfully executed prepared statements are not buffered on the client and
mysql_stmt_fetch()
fetches them one at a time from the server. To cause the complete result
set to be buffered on the client, call
mysql_stmt_store_result()
after binding data buffers with
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...