Rechercher dans le manuel MySQL
28. 7. 11. 17 mysql _stmt _next _result ()
int mysql_stmt_next_result(MYSQL_STMT *mysql)
Description
This function is used when you use prepared
CALL
statements to execute
stored procedures, which can return multiple result sets. Use
a loop that calls
mysql_stmt_next_result()
to
determine whether there are more results. If a procedure has
OUT
or INOUT
parameters,
their values will be returned as a single-row result set
following any other result sets. The values will appear in the
order in which they are declared in the procedure parameter
list.
For information about the effect of unhandled conditions on procedure parameters, see Section 13.6.7.8, “Condition Handling and OUT or INOUT Parameters”.
mysql_stmt_next_result()
returns a status to indicate whether more results exist. If
mysql_stmt_next_result()
returns an error, there are no more results.
Before each call to
mysql_stmt_next_result()
, you
must call
mysql_stmt_free_result()
for
the current result if it produced a result set (rather than
just a result status).
After calling
mysql_stmt_next_result()
the
state of the connection is as if you had called
mysql_stmt_execute()
. This
means that you can call
mysql_stmt_bind_result()
,
mysql_stmt_affected_rows()
,
and so forth.
It is also possible to test whether there are more results by
calling mysql_more_results()
.
However, this function does not change the connection state,
so if it returns true, you must still call
mysql_stmt_next_result()
to
advance to the next result.
For an example that shows how to use
mysql_stmt_next_result()
, see
Section 28.7.25, “C API Prepared CALL Statement Support”.
Return Value | Description |
---|---|
0 | Successful and there are more results |
-1 | Successful and there are no more results |
>0 | An error occurred |
Commands were executed in an improper order.
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-next-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.