Questions tagged [snowsql]

SnowSQL is a command line tool for connecting to the Snowflake analytic data warehouse which is a Software-as-a-Service (SaaS) product.

SnowSQL is the next-generation command line client for connecting to Snowflake to execute SQL queries and perform all DDL and DML operations, including loading data into and unloading data out of database tables.

Snowflake is an analytic data warehouse provided as Software-as-a-Service (SaaS). Snowflake provides a data warehouse that is faster, easier to use, and far more flexible than traditional data warehouse offerings.

Link to documentation and more information

110 questions
0
votes
1 answer

Capturing Snowsql return code within a powershell script

I am using a powershell script to run a sql file using SnowSQL. My idea is to use the powershell script as a generic wrapper to run various sql files with different input parameters, executed from jobs scheduled in the enterprise scheduler. Below is…
user3365490
  • 83
  • 1
  • 1
  • 5
0
votes
1 answer

How to call SQL scripts from snowpipe

I have created a file with multiple DMLs. And then I call that file from SNOWSQL client. Is is possible to do that same via snowpipe so that I don't need to call the file manually every time? Below is the script that I am using in snowsql…
0
votes
2 answers

Snowflake Snowsql conditional breaking IF, SWITCH

Question is around Snowflake snowsql. And need to do a conditional check to see if an ETL_Date is already insert into a table and if it has; exit the stored proc. ELSE if date is not inserted go ahead and insert data and then return success(zero)…
junketsu
  • 533
  • 5
  • 17
0
votes
2 answers

Snowflake query slowness

Did anyone observed slowness when querying data from snowflake(select statement) with OS Windows 2016 + pycharm environment. Getting result quickly with window 10 OS with same environment. When checked network performance using wireshark, round…
0
votes
2 answers

Date parsing issue in the where clause in Snowflake query

I am running a Snowflake query that is intended to return records that among other things, have a date earlier than the current date. select * from table_a where id < 100 and date < ??? The problem is, the data this query is running on has issues…
0
votes
1 answer

How to use alter table drop columns for columns present in a list?

I have a list of all column names to be dropped from multiple tables in a schema, but not all the column names in the list have it's presence in all the tables. For the schema and the table name I have can I in a single query do a check if the…
0
votes
1 answer

How to convert all the column data in snowflake/database to upper case with a with a single query in Snowsql?

I would like to convert all the data if in lower case in snowflake table to upper case. I have multiple catalogs, schemas and then tables. Would like to do this with Python. Is there a straight query on table to convert all the data (columns) into…
0
votes
1 answer

convert multiple rows to one comma separated values in snowflake

I need to convert multiple records/rows in a column to a single comma separated values in snowflake. I was using FOR XML in MSSQL SERVER for the same, but I need to do the same in SNOWSQL. Example - Column-1 with three values A, B,…
Amit
  • 11
  • 2
0
votes
2 answers

OSError: Tunnel connection failed: 407 Proxy Authorization Required - snowsql

I am trying to connect to snowflake database using command line argument snowsql -c example but I am getting below error. Failed to execute request: HTTPSConnectionPool(host='xyz.azure.snowflakecomputing.com', port=443): Max retries exceeded with…
harshac
  • 11
  • 1
  • 3
0
votes
2 answers

Not able to install Snowflake connector for Python in Linux

I am not able to install connector for Snowflake Python using the below command : python3 -m pip3 install --upgrade snowflake-connector-python Its failing with below error : /home/ssg.petsmart.com/nrahman/python3.8.5/bin/python3: No module named…
Naveed
  • 361
  • 1
  • 7
  • 14
0
votes
0 answers

How to fix JSON data Special character issue in snowflake (UTF-8 conversion error - snowflake table loaded with �)?

JSON file from S3 to snowflake failed. Here S3_STG_AREA_JSON is the staging area & STG_TABLE_NAME_JSON is staging table. Statement executed : COPY INTO STG_TABLE_NAME_JSON FROM @S3_STG_AREA_JSON FILE_FORMAT=(TYPE='json'…
0
votes
2 answers

SnowSQL connection test fails with "No module named 'win32timezone'"

I've just installed SnowSQL for Windows as per the instructions at https://docs.snowflake.com/en/user-guide/snowsql-install-config.html#installing-snowsql-on-microsoft-windows-using-the-installer However, when I attempt to connect to Snowflake, it…
Dan Horne
  • 73
  • 1
  • 4
0
votes
1 answer

How to generate a range of numbers between two numbers inside a cell in SQL

I have a table with one column duration containing integer values, and I'm trying to build an other column, using a sql query, that would contain an a list of integer between 1 and the value in the duration column. For example: duration | range 3 …
0
votes
1 answer

How to achieve the flow of execution in a Stored Proc and get an table output

How can we achieve the flow of execution in a Stored Proc and get a table output? Is this possible to call DEMO_PROC and get the output of (SELECT DISTINCT * FROM #TEMP_TABLE) mentioned in the proc? Or is there any alternate way by which this can be…
Amit
  • 11
  • 2
0
votes
1 answer

SQL compilation error: syntax error line 21 at position 6 unexpected '@CPG'. syntax error line 21 at position 29 unexpected ','

I am trying to create a new table in snowflake, but it is giving me the above error, how do i resolve this issue?? Does snowflaqke have problem with @ symbol while creating Has anyone else encountered this issue?? CREATE OR REPLACE TABLE F58155 ( …