DBResultSet < Handle

Last Updated2021-01-14
Created At2014-12-15

Represents a set of results returned from executing a query.

Methods10
SymbolDescription
FetchFloatFetches a float from a field in the current row of a result set. If the result is NULL, a value of 0.0 will be returned. A NULL check can be done with the result parameter, or SQL_IsFieldNull().
FetchIntFetches an integer from a field in the current row of a result set. If the result is NULL, a value of 0 will be returned. A NULL check can be done with the result parameter, or SQL_IsFieldNull().
FetchMoreResultsAdvances to the next set of results. In some SQL implementations, multiple result sets can exist on one query. This is possible in MySQL with simple queries when executing a CALL query. If this is the case, all result sets must be processed before another query is made.
FetchRowFetches a row from the current result set. This must be successfully called before any results are fetched. If this function fails, MoreRows can be used to tell if there was an error or the result set is finished.
FetchSizeReturns the length of a field's data in the current row of a result set. This only needs to be called for strings to determine how many bytes to use. Note that the return value does not include the null terminator.
FetchStringFetches a string from a field in the current row of a result set. If the result is NULL, an empty string will be returned. A NULL check can be done with the result parameter, or SQL_IsFieldNull().
FieldNameToNumRetrieves a field index by name.
FieldNumToNameRetrieves the name of a field by index.
IsFieldNullReturns whether a field's data in the current row of a result set is NULL or not. NULL is an SQL type which means "no data."
RewindRewinds a result set back to the first result.
Properties6
SymbolTypeDescription
AffectedRowsintReturns the number of affected rows from the query that generated this result set.
FieldCountintRetrieves the number of fields in the last result set.
HasResultsboolReturns whether or not a result set exists. This will return true even if 0 results were returned, but false on queries like UPDATE, INSERT, or DELETE.
InsertIdintReturns the insert id from the query that generated this result set.
MoreRowsboolReturns if there are more rows.
RowCountintRetrieves the number of rows in the last result set.