Home | Trees | Indices | Help |
---|
|
object --+ | Result
Query result object.
This object provides a method to retrieve the results from a query using the mysql.connection.Connection.execute method.
Typically you call fetch_row until it raises mysql.exceptions.No_More_Rows to retrieve the data. You can also iterate over the result object to retrieve the data, or call fetch_all_rows to fetch all the data at once.
The type of data returned depends on the field type and the conversion routines defined when you created the mysql.connection.Connection object. See mysql.conversion for more detail about data conversion and the default conversions available.
If you specified store_result as False (the default) to the execute method, then the results are buffered on the server side. You can have only 1 live Result object per connection in this case. If you attempt to create another result object, then your old result object will be forcefully closed.
Attempting to access the result object after it is closed will result in raising mysql.exceptions.Result_Closed_Error. Attempting to access the result object after the connection is closed will result in raising mysql.exceptions.Not_Connected_Error.
The __len__ method is also implemented, but you should read the num_rows docstring for limitations.
|
|||
|
__iter__(x) iter(x) |
||
|
__len__(x) len(x) |
||
|
__new__(T,
S,
...) Returns a new object with type S, a subtype of T... |
||
|
close(...) Release the internally buffered result data. |
||
|
closed(...) Check if the result is closed. |
||
|
fetch_all_rows(...) Return all remaining rows in the result. |
||
|
fetch_container(...) Fetch one row of data into a container. |
||
|
fetch_row(...) Return one row from the result. |
||
|
fields(...) Return all field types. |
||
|
next(x) Returns the next value, or raise StopIteration... |
||
|
num_fields(...) Returns the number of fields in the result. |
||
|
num_rows(...) Return the number of rows in the result. |
||
|
row_seek(...) Set the current row position. |
||
|
row_tell(...) Indicate the current row position. |
||
Inherited from |
|
|||
|
__pyx_vtable__ = <PyCObject object at 0x847ff98>
|
|
|||
Inherited from |
|
iter(x) |
len(x) |
|
Release the internally buffered result data. This will release any internally held information about the result. This will render the result object useless. This is automatically called when the object is deleted. If the result is already closed, this does nothing. Further attempts to use the result object will raise mysql.exceptions.Result_Closed_Error. |
Check if the result is closed. This can be used to check if the result has been closed with the close method. This is the only method you may call (besides close) on a closed Result object.
|
Return all remaining rows in the result. This will return a list of rows (each row being a tuple itself).
|
Fetch one row of data into a container. This will fetch one row of data. It will set the output of each column into the container using setattr. If a column name is aliased with "AS", then the aliased name will be used for setting the value in the container.
|
Return one row from the result.
|
Return all field types.
|
|
Returns the number of fields in the result.
|
Return the number of rows in the result. Note The behavior of this method depends on whether store_result was set in the call to execute. If store_result was False, then this only returns the correct result after all the rows have been fetched. If it was True, then it will always return the correct result.
|
Set the current row position. Note This is only available if the result was stored by passing True to the store_result parameter in the execute call.
|
Indicate the current row position. Note This is only available if the result was stored by passing True to the store_result parameter in the execute call. It returns an opaque object to be used with row_seek.
|
|
__pyx_vtable__
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0alpha3 on Sun Nov 12 20:01:34 2006 | http://epydoc.sourceforge.net |