How to Execute Many SQL Statements from a File Using the Python Connector for Snowflake

Поделиться
HTML-код
  • Опубликовано: 10 июн 2021
  • Often, database developers need to prepare a sequence of SQL statements in a file, so that they can be executed at a later time or from a different location. In this episode, I’ll show you how to execute many SQL statements in a local file against your Snowflake database. The Python Connector for Snowflake provides a nice easy way to accomplish this, through the execute_stream method. Let’s go and update our Snowflake database!
    Related Videos:
    Python on Snowflake - Getting started with the Snowflake Connector for Python
    • Python on Snowflake - ...
    Python on Snowflake: Create and Populate a Database and Retrieve Data
    • Python on Snowflake: C...
    How to Use write_pandas to Migrate Dataframes into Snowflake Databases
    • How to Use write_panda...
    How to Query Snowflake Data into Pandas Dataframes
    • How to Query Snowflake...
    How to Execute Many SQL Statements from a File Using the Python Connector for Snowflake
    You are watching this one now!
    Use Parameters on Snowflake Queries with the Python Connector
    • Use Parameters on Snow...
    How to Use execute_string for Many SQL Statements Using Python on Snowflake
    • How to Use execute_str...
    Python on Snowflake - How to Use executemany with Lists or Tuples for Parameters
    • Python on Snowflake - ...
    Want to work with me 1:1? Contact me today and book your free 20 min consultation!
    Contact form you can find at www.mackenziemackenzie.com/
    Follow me on social media:
    / mackenziedataanalytics
    / seamacke
    / seamacke
    / seamacke
    / psmackenzie
    Get Microsoft Office including Access:
    click.linksynergy.com/fs-bin/...
    Got a RUclips Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy.com/seanmackenz...
    For developers looking for a new role, check out:
    www.toptal.com/qKaO2b/worlds-...
    Needing to hire technical resources for your project? Get the best:
    www.toptal.com/qKaO2b/worlds-...
    #Snowflake #SQLstatements #Python
    • How to Execute Many SQ...
  • НаукаНаука

Комментарии • 7

  • @phugacious
    @phugacious 2 года назад +1

    Sir you are a rockstar!! Thanks for these videos. Really appreciate it 👍

  • @Buzzingfact
    @Buzzingfact 2 года назад +1

    How can we validate the error rows which happened during loading from python to snowflake using write pandas

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 года назад +1

      Great question! Take a look at the error code you're getting for those and then look at the data to see if there are any datatype mixups, length issues or other types of problems with those rows. Correct them and then try again, or adjust your input query to account for the write operation.