|
Python Connector for Snowflake Using the module - Python Connector for Snowflake |
|
To retrieve data from Snowflake:
import devart.snowflake as snowflake
connect() module method and obtain a connection object.
my_connection = snowflake.connect(
Domain="your_instance;",
UserId="your_username",
Password="your_password",Database="your_database;"
)
cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
execute() cursor method.
my_cursor.execute("SELECT * FROM employees")
fetch*() cursor methods.
for row in my_cursor.fetchall():
print(row)