Rechercher dans le manuel MySQL
28. 7. 11. 28 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
mysql_stmt_bind_result()
and
before calling
mysql_stmt_fetch()
to fetch
rows. (For an example, see
Section 28.7.11.11, “mysql_stmt_fetch()”.)
mysql_stmt_store_result()
is
optional for result set processing, unless you will call
mysql_stmt_data_seek()
,
mysql_stmt_row_seek()
, or
mysql_stmt_row_tell()
. Those
functions require a seekable result set.
It is unnecessary to call
mysql_stmt_store_result()
after executing an SQL statement that does not produce a
result set, but if you do, it does not harm or cause any
notable performance problem. You can detect whether the
statement produced a result set by checking if
mysql_stmt_result_metadata()
returns NULL
. For more information, refer
to Section 28.7.11.23, “mysql_stmt_result_metadata()”.
MySQL does not by default calculate
MYSQL_FIELD->max_length
for all
columns in
mysql_stmt_store_result()
because calculating this would slow down
mysql_stmt_store_result()
considerably and most applications do not need
max_length
. If you want
max_length
to be updated, you can call
mysql_stmt_attr_set(MYSQL_STMT,
STMT_ATTR_UPDATE_MAX_LENGTH, &flag)
to enable
this. See Section 28.7.11.3, “mysql_stmt_attr_set()”.
Commands were executed in an improper order.
Out of memory.
The MySQL server has gone away.
The connection to the server was lost during the query.
An unknown error occurred.
Traduction non disponible
Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-mysql-stmt-store-result.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.