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
8
votes
4 answers

How do I construct an array of dates in a given date range using snowsql?

Given two dates, I would like to create an array that holds all of the days between those dates and then filter it to contain only the days that fall at the end of a month. For example, with start_date 2019-01-31 and end_date 2019-06-30, I would to…
Sains
  • 457
  • 1
  • 7
  • 19
5
votes
5 answers

SnowSQL fails with "The library Security could not be found" after upgrading to mac Big Sur

After upgrading to macOS Big Sur my snowsql scripts all fail with "The Library Security could not be found" $ snowsql -q "select 1 x" User: me Password: XXX The library Security could not be found If the error message is unclear, enable logging…
user14072884
  • 65
  • 1
  • 4
5
votes
5 answers

After installation of Snowsql I am getting Failed to initialize log. No logging is enabled: [Errno 13] Permission denied: 'C:\\Users\\snowsql_rt.log'

HI I have downloaded and installed SNowSQL onto my Windows Machine 64 bit machine After entering command snowsql -a zx12334 -u someone ; i am getting following error Failed to initialize log. No logging is enabled: [Errno 13] Permission denied:…
Aniruddha Shinde
  • 124
  • 1
  • 2
  • 11
5
votes
2 answers

Can we pass list or array as parameter to JavaScript procedure in snowflake?

Can we pass list or array as parameter to javascript procedure in snowflake? I am working on procedure which would run weekly and delete a week old data from certain tables. Instead of creating task for individual table, I want to pass table names…
Sujata Shakya
  • 51
  • 1
  • 2
5
votes
1 answer

Snowflake SQL: How to add a time to a date to make a datetime?

I have a date column and a time column and I'd like to make a datetime/timestamp. I've tried Date+Time but I get: SQL compilation error: error line 4 at position 14 Invalid argument types for function '+': (DATE, TIME(9))
Neil P
  • 2,920
  • 5
  • 33
  • 64
4
votes
2 answers

Adding escape sequence for space in Snowflake PUT command

I have been trying to load a file into Snowflake using PUT but I am getting an error due to space in the folder name. PUT file://Y:/AMI Control/file.csv @MS_FILE_LND AUTO_COMPRESS=FALSE I have tried using \ escape sequence and enclosing the entire…
Vishnu Prasad
  • 73
  • 1
  • 9
4
votes
2 answers

How do you stop a running query in SnowSQL

Is it possible to stop a running query in the SnowSQL command line tool? Let's say I made a mistake and I tried to run a heavy query. Control-C, Esc, Q... nothing seems to stop it. The only way seems to be to send a kill command. I also tried to…
jmriego
  • 335
  • 3
  • 15
4
votes
1 answer

Summing values from a JSON array in Snowflake

I have a source data which contains the following type of a JSON array: [ [ "source 1", 250 ], [ "other source", 58 ], [ "more stuff", 42 ], ... ] There can be 1..N pairs of strings and values like this.…
Markus Rautopuro
  • 7,997
  • 6
  • 47
  • 60
4
votes
3 answers

Snowflake CLI (Snowsql) - query tagging

When a query is run from the snowsql shell, i get to see the generated query id on the UI. Later on if i have to search for the same in the history, i want to search the query id that i can define or someway to tag the query. Is it possible to…
Manikandan Kannan
  • 8,684
  • 15
  • 44
  • 65
3
votes
2 answers

Snowflake show tables not accessed in last 20 days

There is a situation where I need to clean up my database in snowflake. we have around 40 database and each database has more than 100 table. Some are getting loaded everyday and some are not, but used everyday. However, There has been lots of table…
3
votes
5 answers

Connect with Snowsql

I would like to set up Snowsql client so I can connct for the first time and run commands like PUT. I dont know where to find exacte values of : accountname = xxxx username = xxxx password = xxxx When I run following command from Windows command…
3
votes
1 answer

Snowflake - trying to load a row of csv data into Variant - "Error parsing JSON:"

I'm trying to load the entirety of each row in a csv file into a variant column. my copy into statement fails with the below Error parsing JSON: Which is really odd as my data isn't JSON and I've never told it to try and validate it as…
Neil P
  • 2,920
  • 5
  • 33
  • 64
2
votes
2 answers

(Oracle) Convert us7ascii in Snowflake?

I'm looking for an alternative for the oracle convert() function in Snowflake. More specifically speaking I want to replace special characters in a string value (e.g. é, ä, ö) with the best matching letters. In Oracle I can do something like…
2
votes
1 answer

How to schedule a daily sql script in snowflake db

How to schedule a sql script in the snowflake database to run every day, and set the output file name to include the current date. E.g. if the code ran today then the file name should be 20200906*****.csv.gz, similary for tomorrow…
2
votes
2 answers

Snowflake DB: How to run a report showing all database/schema names?

In Snowflake database, I can have a report showing all database names by SELECT * from information_schema.databases; In each DB, I can select all schema names by select catalog_name as database, schema_name from …
dave
  • 296
  • 1
  • 12
  • 26
1
2 3 4 5 6 7 8