my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *attr);
Le résultat est différent de 0 en cas de succès.
#include <mysql.h>
static MYSQL_STMT *hOrdreSql;
static unsigned long Option;
...
Option=CURSOR_TYPE_NO_CURSOR;
if (mysql_stmt_attr_set(hOrdreSql, STMT_ATTR_CURSOR_TYPE, (void *)&Option))
{
...
}
...
Option=256;
if (mysql_stmt_attr_set(hOrdreSql, STMT_ATTR_PREFETCH_ROWS, (void *)&Option))
{
...
}
...
if (mysql_stmt_attr_get(hOrdreSql, STMT_ATTR_CURSOR_TYPE, (void *)&Option))
{
...
}
...
if (mysql_stmt_attr_get(hOrdreSql, STMT_ATTR_PREFETCH_ROWS, (void *)&Option))
{
...
}
...