Loading...

verticapy.connection.current_cursor#

verticapy.connection.current_cursor() Cursor#

Returns the current database cursor.

Examples#

Get the current cursor:

from verticapy.connection import current_cursor

cur = current_cursor()
cur

<vertica_python.vertica.cursor.Cursor at 0x11a7b4748>

Directly execute an SQL query:

cur.execute("SELECT version();").fetchone()

['Vertica Analytic Database v12.0.4-0']

See also

current_connection() : Returns the current VerticaPy connection.
new_connection() : Creates a new VerticaPy connection.
set_connection() : Sets the VerticaPy connection.