How to use Amazon Redshift Replace Function?

The Amazon Redshift REPLACE function is one of the important string functions. The replace function allows you to manipulate the string in Amazon Redshift. This string function is similar to translate and regexp_replace functions. Amazon Redshift Replace Function Page Contents Introduction to Amazon Redshift Introduction to Amazon Redshift Syntax of the Redshift Replace Function Redshift Replace Function Example Usage of the Redshift Replace Function Best practices for using the Redshift Replace Function Conclusion Introduction to Amazon Redshift Amazon Redshift is a fully managed, cloud-based data warehouse service offered by Amazon…

Continue ReadingHow to use Amazon Redshift Replace Function?
Comments Off on How to use Amazon Redshift Replace Function?

What is ENDS_WITH Function Alternative in Redshift?

The relational databases such as Oracle and cloud databases such as BigQuery, Snowflake supports ends with function. The function name may be different, but the functionality is same. For example, Oracle and BigQuery provides ENDS_WITH function and Snowflake contains ENDSWITH function. The Amazon Redshift does not provide ENDS_WITH function. In my other article, What is STARTS_WITH Function Alternative in Redshift, we have seen starts_with alternative in Redshift. In this article, we will check what is ENDS_WITH function alternative in AWS Redshift? ENDS_WITH Function In Redshift Not all the string functions…

Continue ReadingWhat is ENDS_WITH Function Alternative in Redshift?
Comments Off on What is ENDS_WITH Function Alternative in Redshift?

What is STARTS_WITH Function Alternative in Redshift?

The relational databases such as Oracle and cloud databases such as BigQuery, Snowflake supports starts with function. The function name may be different, but the functionality is same. For example, Oracle and BigQuery provides STARTS_WITH function and Snowflake contains STARTSWITH function. The Amazon Redshift does not provide STARTS_WITH function. In my other article, What is ENDS_WITH Function Alternative in Redshift, we have seen ends_with alternative in Redshift. In this article, we will check what is STARTS_WITH function alternative in AWS Redshift? STARTS_WITH Function In Redshift Not all the string functions…

Continue ReadingWhat is STARTS_WITH Function Alternative in Redshift?
Comments Off on What is STARTS_WITH Function Alternative in Redshift?

Snowflake NULL Handling Functions, Usage and Examples

A NULL value in a relational database is a special marker used in SQL to indicate that a data value is UNKNOWN or does not exist in the database. In other words, a NULL value is just a placeholder to denote values that are missing or it is unknown. Snowflake supports NULL handling functions that are available in other cloud data warehouse such as Redshift, Azure Synapse, etc. Along with those, Snowflake also supports many extended functions to handle null values. In this article, we will check Snowflake NULL handling functions, usage and some examples. Snowflake NULL…

Continue ReadingSnowflake NULL Handling Functions, Usage and Examples
Comments Off on Snowflake NULL Handling Functions, Usage and Examples

Snowflake Error handling – Procedure and Functions

Snowflake Cloud data warehouse supports stored procedures to support migration from other relational databases. Snowflake allows you to write stored procedure using JavaScript APIs. It also supports error handling using try/catch block. However, it also supports built-in functions such as try_cast to handle error during type conversion. In this article, we will check methods for handling error in Snowflake procedures and functions. Snowflake Error handling The Snowflake allows you to handle errors with the help of try/catch block when you write a procedure or function using the JavaScript API. Snowflake…

Continue ReadingSnowflake Error handling – Procedure and Functions
2 Comments

Snowflake Concat Function and Operator – Examples

The Snowflake cloud architecture supports data ingestion from multiple sources, hence it is a common requirement to combine data from multiple columns to come up with required results. You may also get a requirement to concatenate multiple strings before loading them to target table. For example, you may get requirement to combine state and city columns before loading data to the customer address table. In this article, we will check Snowflake CONCAT function, its Syntax and examples. We will also check how to combine two or more columns using Snowflake…

Continue ReadingSnowflake Concat Function and Operator – Examples
Comments Off on Snowflake Concat Function and Operator – Examples

SQL INITCAP Function Alternative in Azure Synapse and TSQL

The INITCAP function is one of the quite useful functions you can use to capitalize the first letter (CamelCase) of each word. The popular relational databases such as Oracle, Teradata, etc. support INITCAP function to represent strings in a CamelCase. But, same function will not work on the Microsoft SQL Server or Azure Synapse analytics data warehouse. Both SQL Server and Azure Synapse databases are based on TSQL. In this article, we will check what are the INITCAP function alternative in Azure Synapse and TSQL. INITCAP Function Alternative in Azure…

Continue ReadingSQL INITCAP Function Alternative in Azure Synapse and TSQL
Comments Off on SQL INITCAP Function Alternative in Azure Synapse and TSQL

SQL LPAD and RPAD Functions Alternative in Synapse and TSQL

Many relational databases such as Oracle, Teradata supports LPAD and RPAD functions. These functions are quite useful when you are formatting data before storing it in a database or displaying data on reports. For example, add zero to integer column. But, Azure Synapse data warehouse which is based on the Microsoft SQL Server TSQL does not support LPAD and RPAD functions. You have to use TSQL built-in functions or create your own user defined functions (UDF). In this article, we will check what are the LPAD and RPAD Functions Alternative…

Continue ReadingSQL LPAD and RPAD Functions Alternative in Synapse and TSQL
Comments Off on SQL LPAD and RPAD Functions Alternative in Synapse and TSQL

SQL GREATEST and LEAST Functions Alternative in Synapse and TSQL

Many relational databases such as Oracle, Teradata supports GREATEST and LEAST functions. These functions are quite useful when you are comparing data from two or more columns. But, Azure Synapse data warehouse which is based on the Microsoft SQL Server TSQL does not support GREATEST and LEAST functions. You either have to use a case statement or write your own user defined functions (UDFs). In this article, we will check what are the GREATEST and LEAST Functions Alternative in Synapse and TSQL. GREATEST and LEAST Functions Alternative in Synapse and…

Continue ReadingSQL GREATEST and LEAST Functions Alternative in Synapse and TSQL
Comments Off on SQL GREATEST and LEAST Functions Alternative in Synapse and TSQL

How to Remove Newline Characters from String in Snowflake?

If you store a string as a variable or a column in relational databases such SQL Server , then it can contain line breaks or newline (\n) characters. But, these newline characters have to be removed in pre-processing steps. In this article, we will check how to remove newline characters from a string or text in Snowflake. Remove Newline Characters from String in Snowflake Removing newline (\n), carriage return (\r) or any special characters is the common pre-processing step before storing records in any relational databases. Many databases supports built-in…

Continue ReadingHow to Remove Newline Characters from String in Snowflake?
Comments Off on How to Remove Newline Characters from String in Snowflake?