Python Connector for Snowflake

Using the module - Python Connector for Snowflake

Using the module

To retrieve data from a database:

  1. Import the module.
    import devart.snowflake
  2. Connect to a database using the connect() module method and obtain a connection object.
    my_connection = devart.snowflake.connect(
        Domain="your_instance;",
    UserId="your_username",
    Password="your_password",Database="your_database;" )
  3. Create a cursor object using the cursor() connection method.
    my_cursor = my_connection.cursor()
  4. Execute the SQL statement using the execute() cursor method.
    my_cursor.execute("SELECT * FROM employees")
  5. Retrieve the result set using one of the fetch*() cursor methods.
    for row in my_cursor.fetchall(): 
        print(row)
© 2022-2024 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback