How do we connect to snowflake using python connector and execute multiple sql statements, instead of writing multiple cursor execute()?
If we have a sql script, can we run the script by using the python snowflake connector? is there a better way to connect to snowflake?
import snowflake.connector
ctx=snowflake.connector.connect(
user=user,
password=password,
account=account
)
cs=ctx.cursor()
query="select * from table;"//sql query like select *
try:
cs.execute(query)
output=cs.fetchall()
print(output)
finally:
cs.close()
ctx.close()