Use Parameters on Snowflake Queries with the Python Connector

preview_player
Показать описание
Parameterized queries are very important in the world of data engineering, and it is no different when you’re connecting to your Snowflake database. Luckily, the Snowflake Connector for Python gives us two great ways to use parameters in our queries. These methods will help guard against SQL injection attacks, and will make your queries more robust and efficient. Let’s look at our qmark and numeric parameter styles for querying Snowflake today!

Related Videos:
Python on Snowflake - Getting started with the Snowflake Connector for Python
Python on Snowflake: Create and Populate a Database and Retrieve Data
How to Use write_pandas to Migrate Dataframes into Snowflake Databases
How to Query Snowflake Data into Pandas Dataframes
How to Execute Many SQL Statements from a File Using the Python Connector for Snowflake
Use Parameters on Snowflake Queries with the Python Connector
You are watching this one now!
How to Use execute_string for Many SQL Statements Using Python on Snowflake
Python on Snowflake - How to Use executemany with Lists or Tuples for Parameters

Want to work with me 1:1? Contact me today and book your free 20 min consultation!

Follow me on social media:

Get Microsoft Office including Access:

Got a YouTube Channel? I use TubeBuddy, it is awesome. Give it a try:

For developers looking for a new role, check out:

Want my team to do a project for you? Let's get to it!

#Snowflake #ParameterizedQuery #PythonConnector

Рекомендации по теме
Комментарии
Автор

Great video!
What is the advantage of using the pandas connector for snowflake?
Edit: Could we do a similar parameterization using a redshift instance/connector?

Jmignet
Автор

Very good explanation, for i’ve a scenario where I’ve to define multiple snowflake data names that I have to use in my query how do I define multiple database??

USE Database db1, db2, db3..

sri
Автор

Thank you again sir. However I noticed that you used cs.execute() and passed the parameters. Is there a way to do the same with pandas e.g. in pd.read_sql() method can we parameterize our SQL query??

Thanks again in advance. Really appreciate all your videos

phugacious
Автор

Is it possible to parameterize the table names?

nikhilm