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
1
vote
3 answers

How to return values from same table?

I've two tables A and B. I want to return all records from A and only matching from B. I can use left join for this. But after joining, I want to return records based on a flag in the same table. Table A: | Col1 | Col2 | |------|------| | 123 | …
django-unchained
  • 844
  • 9
  • 21
1
vote
1 answer

How to do Delta Loads into SQL

How would you do Delta Loads into Snowflake tables? I have been looking on snowflakes documentation but I haven't been able to find anything on the topic. Thanks
0
votes
1 answer

Load data from Snowflake table to aws s3 in batches for a very large files

I have a task to load a large table from Snowflake to s3. I need to load 1000 records from the table of snowflake in a csv file to s3, and consecutively next 1000 records from the table in another csv file and so on. For example, I have a table of…
0
votes
1 answer

snowsql option while exporting data to a csv file in unix

we are exporting data into a csv file by using unix shell script (using snowsql) below is the script #!/bin/ksh snowsql -c newConnection -o log_level=DEBUG -o log_file=~/snowsql_sso_debug.log -r SRVC_ACCT_ROLE -w LOAD_WH -d ETL_DEV_DB -s CTL_DB -q…
BalajiAWS
  • 137
  • 1
  • 12
0
votes
2 answers

SPLIT_PART for LDAP

I am trying to understand if there is a way we can use SPLIT_PART in Snowflake that will break down the users from a LDAP Membership. If not SPLIT_PART, any other approaches? The following exists as a single record which I want to split as three…
Julaayi
  • 403
  • 2
  • 8
  • 23
0
votes
1 answer

NLSSORT Oracle to Snowflake

I'm trying to convert the following code from Oracle to Snowflake: order by nlssort(name, 'NLS_SORT=BINARY') I know NLSSORT is not a function in Snowflake, but is there anything I can use as an alternative?
0
votes
3 answers

How to escape double quotes within a data when it is already enclosed by double quotes

I have CSV data separated by comma like below which has to be imported into snowflake table using copy command . "1","2","3","2"In stick" Since I am already passing the parameter OPTIONALLY_ENCLOSED_BY = '"' to copy command I couldn't escape the "…
0
votes
2 answers

Create External Table pointing to S3

How do we create an external table using Snowflake sql that points to a directory in S3? Below is the code I tried so far, but didn't work. Any help is highly appreciated. create external table my_table ( column1 varchar(4000), column2…
0
votes
1 answer

snowsql to be shared by all users

I have installed snowsql using root account in linux which installed the components on /opt/snowsql directory and all of its other components in ~/.snowsql. The problem is I can run the snowsql commands using root user, but the other users cannot…
Naveed
  • 361
  • 1
  • 7
  • 14
0
votes
1 answer

Are there limitations on Snowflake's split_part function?

Does Snowflake's split_part function have a limit on how large the string or individual delimited parts of the string can be? For e.g. in SQL Server, if any part of the string exceeds 256 bytes, the parsename function will return nullfor that…
Radagast
  • 5,102
  • 3
  • 12
  • 27
0
votes
2 answers

Pass arguments to a sql file via command line arguments in shell script

I am using SnowSQL to run a SQL script. I have command line parameters which needs to also be passed to the SQL script during my SnowSQL call. Here is what I have: SQL script (file.sql): select * from table where cli_id = '$1' and store_id = '$2';…
Hana
  • 1,330
  • 4
  • 23
  • 38
0
votes
3 answers

joining two dataset to get optimal result

Thanks in advance! this is little long question but hopefully it is clear and concise. I have two different query bringing two data sets. both datasets are bringing data in same grain for similar area. first data set has multiple snapshots per month…
0
votes
1 answer

How to convert a string date value to actual date data-type in snowflake

I have a date which is in the format 15-NOV-2019 I am trying to convert this date format in snowflake in actual date data-type i.e. 15/11/2019 I am using this function in looker for conversion try_to_date (15-NOV-2019 , 'DD-MMM-YYYY') in snowflake…
0
votes
2 answers

Convert YYYYMMDD to MM/DD/YYYY in Snowflake

I need help in figuring out the date conversion logic in Snowflake. The documentation isn't clear enough on this. In SQL Server, I would try SELECT CONVERT(DATE, '20200730', 101) and it gives me '07/30/2020'. If I try the following in…
Julaayi
  • 403
  • 2
  • 8
  • 23
0
votes
2 answers

How to replace rows containing alphabets and special characters with Blank spaces in snowflake

I have a column "A" which contains numbers for example- 0001, 0002, 0003 the same column "A" also contains some alphabets and special characters in some of the rows for example - connn, cco*jjj, hhhhhh11111 etc. I want to replace these alphabets and…