dataengref migrate

Home / Teradata

Teradata OREPLACE in Snowflake, Databricks and BigQuery

OREPLACE becomes REPLACE in all three targets. NULL handling differs: Teradata treats a NULL replacement as an empty string, while the targets return NULL.

Teradata function: OREPLACE(source_string, search_string [, replace_string]) · Teradata docs

Equivalents

TargetSupportSyntaxNotesSource
SnowflakeDifferent nameREPLACE(subject, pattern [, replacement])The replacement defaults to an empty string.Snowflake docs
DatabricksDifferent namereplace(str, search [, replace])The replacement defaults to an empty string.Databricks docs
BigQueryDifferent nameREPLACE(original_value, from_pattern, to_pattern)All three arguments are required.BigQuery docs

Behavior differences to check

BigQuery

Examples

Remove dashes from phone numbers

Teradata
SELECT OREPLACE(phone, '-') AS phone_digits FROM customers;
Snowflake
SELECT REPLACE(phone, '-') AS phone_digits FROM customers;
Databricks
SELECT replace(phone, '-') AS phone_digits FROM customers;
BigQuery
SELECT REPLACE(phone, '-', '') AS phone_digits FROM customers;

Other Teradata functions

Last checked: · Paste a whole query into the SQL checker to find every function that needs a change.