Tutorial

The following tutorial explains how to get started using the Vertica Python Client.

This tutorial assumes you have a working instance of a Vertica Database.

Getting Started

In a Python shell, import the Vertica Python Client:

>>> import vertica_db_client

Create a Connection to Your Database

Type the following command to connect to your Vertica database:

>>> db = vertica_db_client.connect(database="verticadb", user='user_1', password='pwd')

Open a Cursor

Type the following command:

>>> cur = db.cursor()

Use this cursor to process queries from the client.

Execute a Query

Write a query against your database:

>>> cur.execute("SELECT * FROM top_100 LIMIT 3")

Retrieve Your Data

Fetch the data using the following command:

>>> rows = cur.fetchall()