nextset()

Overview

Makes the cursor skip to the next available result-set in a query that returns multiple result-sets.

See also: MariaDB Connector/Python 1.1 and in 1.0

DETAILS

Make the cursor skip to the next available result set in a query that returns multiple result sets. Any unread rows in the current result set are discarded.

EXAMPLES

import mariadb

conn = mariadb.connect(
    host = 'localhost',
    user = 'root',
    password = 'secret',
    )

cursor = conn.cursor()

cursor.execute("""
    CREATE PROCEDURE p1(IN i1 VARCHAR(20), OUT o2 VARCHAR(40))
    BEGIN
      SELECT 'hello';
      SET o2 = 'test';
    END
    """)

cursor.callproc('p1', ('foo', 0))
print(cursor.fetchone()) # Prints: ('hello',)

cursor.nextset()

print(cursor.fetchone()) # Prints: ('test',)

cursor.execute("DROP PROCEDURE p1")

CHANGE HISTORY

Release Series

History

1.1

  • Present starting in MariaDB Connector/Python 1.1.2.

1.0

  • Present starting in MariaDB Connector/Python 1.0.0.