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.
Type the following command to connect to your Vertica database:
>>> db = vertica_db_client.connect(database="verticadb", user='user_1', password='pwd')
Type the following command:
>>> cur = db.cursor()
Use this cursor to process queries from the client.
Write a query against your database:
>>> cur.execute("SELECT * FROM top_100 LIMIT 3")
Use a for loop and the print function:
>>> for i, row in enumerate(rows):
... print("Row", i, "Data = ", row)
Row 0 Data = (2, 'Foo Barname', 1950, 2, '4 Spaces One Tab')
Row 1 Data = (3, 'Util Foo', 1950, 3, 'Camelcase and Underscores')
Row 2 Data = (1, 'Rockin Foobar', 1950, 20, 'Foo This Bar That')