Search Results
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlconnection-cmd-query-iter.html
Syntax: cnx.cmd_query_iter(statement) Similar to the cmd_query() method, but returns a generator object to iterate through results. Use cmd_query_iter() when sending multiple statements, and separate the statements with semicolons. The following ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlconnection-time-zone.html
This property is used to set or retrieve the time zone session variable for the current connection. >>> cnx.time_zone = '+00:00' >>> cursor = cnx.cursor() >>> cursor.execute('SELECT NOW()') ; cursor.fetchone() (datetime.datetime(2012, 6, 15, 11, ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursor-execute.html
Syntax: cursor.execute(operation, params=None) iterator = cursor.execute(operation, params=None) # Allowed before 9.2.0 iterator = cursor.execute(operation, params=None, multi=True) This method executes the given database operation (query or ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursor-fetchone.html
Syntax: row = cursor.fetchone() This method retrieves the next row of a query result set and returns a single sequence, or None if no more rows are available. By default, the returned tuple consists of data returned by the MySQL server, converted ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursor-fetchsets.html
Syntax: for statement, result_set in cursor.fetchsets(): # do something with statement and/or result set This method generates a set of result sets caused by the last cursor.execute*(). It returns a generator where each item is a 2-tuple; the first ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursor-fetchwarnings.html
Syntax: tuples = cursor.fetchwarnings() This method returns a list of tuples containing warnings generated by the previously executed operation. To set whether to fetch warnings, use the connection's get_warnings property. The following example ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursor-nextset.html
Syntax: row = cursor.nextset() This method makes the cursor skip to the next available set, discarding any remaining rows from the current set. It returns None if there are no more sets or returns True and subsequent calls to the cursor.fetch*() ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursor-warnings.html
Syntax: tuples = cursor.warnings This property returns a list of tuples containing warnings generated by the previously executed operation. To set whether to fetch warnings, use the connection's get_warnings property. The following example shows a ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursordict.html
The keys for each dictionary object are the column names of the MySQL result. Example: cnx = mysql.connector.connect(database='world') cursor = cnx.cursor(dictionary=True) cursor.execute("SELECT * FROM country WHERE Continent = 'Europe'") ...
https://dev.mysql.com/doc/connectors/en/connector-python-api-mysqlcursorprepared.html
In MySQL, there are two ways to execute a prepared statement: Use the PREPARE and EXECUTE statements. To repeatedly execute the same statement with different data for different executions, this is more efficient than using PREPARE and EXECUTE. For ...