Skip to content
Advertisement

How to execute sql query with python variables null or empty

Hi I’m using python 3 and snowflake. Example:

JavaScript

I tried with this:

JavaScript

I’m getting TypeError: not enough arguments for format string. I would like to run this query for all schemas if I dont have defined MY_SCHEMA variable and also for all tables if MY_TABLE variable is null or empty. I would be grateful for any advice.

Advertisement

Answer

I found a solution this issue:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement