MySQL Shell API 8.0.40
Unified development interface for MySQL Products
Methods | Properties | List of all members
ClassicResult Class Reference

Allows browsing through the result information after performing an operation on the database through the MySQL Protocol. More...

Methods

Row fetchOne ()
 Retrieves the next Row on the ClassicResult. More...
 
Dictionary fetchOneObject ()
 Retrieves the next Row on the result and returns it as an object. More...
 
List fetchAll ()
 Returns a list of Row objects which contains an element for every record left on the result. More...
 
Integer getAffectedItemsCount ()
 The the number of affected items for the last operation. More...
 
Integer getAffectedRowCount ()
 The number of affected rows for the last operation. More...
 
Integer getColumnCount ()
 Retrieves the number of columns on the current result. More...
 
List getColumnNames ()
 Gets the columns on the current result. More...
 
List getColumns ()
 Gets the column metadata for the columns on the active result. More...
 
String getExecutionTime ()
 Retrieves a string value indicating the execution time of the executed operation.
 
Bool hasData ()
 Returns true if the last statement execution has a result set.
 
String getInfo ()
 Retrieves a string providing information about the most recently executed statement. More...
 
Integer getAutoIncrementValue ()
 Returns the last insert id auto generated (from an insert operation). More...
 
Integer getWarningCount ()
 The number of warnings produced by the last statement execution. More...
 
Integer getWarningsCount ()
 The number of warnings produced by the last statement execution. More...
 
List getWarnings ()
 Retrieves the warnings generated by the executed operation. More...
 
Bool nextDataSet ()
 Prepares the SqlResult to start reading data from the next Result (if many results were returned). More...
 
Bool nextResult ()
 Prepares the SqlResult to start reading data from the next Result (if many results were returned). More...
 

Properties

Integer affectedItemsCount
 Same as getAffectedItemsCount()
 
Integer affectedRowCount
 Same as getAffectedRowCount() More...
 
Integer columnCount
 Same as getColumnCount()
 
List columnNames
 Same as getColumnNames()
 
List columns
 Same as getColumns()
 
String executionTime
 Same as getExecutionTime()
 
String info
 Same as getInfo()
 
Integer autoIncrementValue
 Same as getAutoIncrementValue()
 
List warnings
 Same as getWarnings()
 
Integer warningCount
 Same as getWarningCount() More...
 
Integer warningsCount
 Same as getWarningsCount()
 

Detailed Description

Allows browsing through the result information after performing an operation on the database through the MySQL Protocol.

This class allows access to the result set from the classic MySQL data model to be retrieved from Dev API queries.

Member Function Documentation

◆ fetchOne()

Row fetchOne ( )

Retrieves the next Row on the ClassicResult.

Returns
A Row object representing the next record in the result.

◆ fetchOneObject()

Dictionary fetchOneObject ( )

Retrieves the next Row on the result and returns it as an object.

Returns
A dictionary containing the row information.

The column names will be used as keys in the returned dictionary and the column data will be used as the key values.

If a column is a valid identifier it will be accessible as an object attribute as <dict>.<column>.

If a column is not a valid identifier, it will be accessible as a dictionary key as <dict>[<column>].

◆ fetchAll()

List fetchAll ( )

Returns a list of Row objects which contains an element for every record left on the result.

Returns
A List of Row objects.

If this function is called right after executing a query, it will return a Row for every record on the resultset.

If fetchOne is called before this function, when this function is called it will return a Row for each of the remaining records on the resultset.

◆ getAffectedItemsCount()

Integer getAffectedItemsCount ( )

The the number of affected items for the last operation.

Returns
the number of affected items.

◆ getAffectedRowCount()

Integer getAffectedRowCount ( )

The number of affected rows for the last operation.

Returns
the number of affected rows.
Attention
This function will be removed in a future release, use the getAffectedItemsCount function instead.

This is the value of the C API mysql_affected_rows(), see https://dev.mysql.com/doc/refman/en/mysql-affected-rows.html

◆ getColumnCount()

Integer getColumnCount ( )

Retrieves the number of columns on the current result.

Returns
the number of columns on the current result.

◆ getColumnNames()

List getColumnNames ( )

Gets the columns on the current result.

Returns
A list with the names of the columns returned on the active result.

◆ getColumns()

List getColumns ( )

Gets the column metadata for the columns on the active result.

Returns
a list of column metadata objects containing information about the columns included on the active result.

◆ getInfo()

String getInfo ( )

Retrieves a string providing information about the most recently executed statement.

Returns
a string with the execution information.

For more details, see: https://dev.mysql.com/doc/refman/en/mysql-info.html

◆ getAutoIncrementValue()

Integer getAutoIncrementValue ( )

Returns the last insert id auto generated (from an insert operation).

Returns
the integer representing the last insert id.

For more details, see https://dev.mysql.com/doc/refman/en/information-functions.html#function_last-insert-id

◆ getWarningCount()

Integer getWarningCount ( )

The number of warnings produced by the last statement execution.

Returns
the number of warnings.
Attention
This function will be removed in a future release, use the getWarningsCount function instead.

This is the same value than C API mysql_warning_count, see https://dev.mysql.com/doc/refman/en/mysql-warning-count.html

See getWarnings() for more details.

See also
warnings

◆ getWarningsCount()

Integer getWarningsCount ( )

The number of warnings produced by the last statement execution.

Returns
the number of warnings.

This is the same value than C API mysql_warning_count, see https://dev.mysql.com/doc/refman/en/mysql-warning-count.html

See getWarnings() for more details.

See also
warnings

◆ getWarnings()

List getWarnings ( )

Retrieves the warnings generated by the executed operation.

Returns
a list containing a warning object for each generated warning.

Each warning object contains a key/value pair describing the information related to a specific warning.

This information includes: level, code and message.

This is the same value than C API mysql_warning_count, see https://dev.mysql.com/doc/refman/en/mysql-warning-count.html

◆ nextDataSet()

Bool nextDataSet ( )

Prepares the SqlResult to start reading data from the next Result (if many results were returned).

Returns
A boolean value indicating whether there is another result or not.
Attention
This function will be removed in a future release, use the nextResult function instead.

◆ nextResult()

Bool nextResult ( )

Prepares the SqlResult to start reading data from the next Result (if many results were returned).

Returns
A boolean value indicating whether there is another esult or not.

Member Data Documentation

◆ affectedRowCount

Integer affectedRowCount

Same as getAffectedRowCount()

Attention
This property will be removed in a future release, use the affectedItemsCount property instead.

◆ warningCount

Integer warningCount

Same as getWarningCount()

Attention
This property will be removed in a future release, use the warningsCount property instead.