dataengref migrate

Home / Oracle

Oracle NVL in Snowflake, Databricks and BigQuery

Snowflake and Databricks support NVL directly. BigQuery uses IFNULL. The bigger migration risk is Oracle treating empty strings as NULL, which none of the targets do.

Oracle function: NVL(expr1, expr2) · Oracle docs

Equivalents

TargetSupportSyntaxNotesSource
SnowflakeSame nameNVL(expr1, expr2)Alias of IFNULL.Snowflake docs
DatabricksSame namenvl(expr1, expr2)Synonym of coalesce(expr1, expr2).Databricks docs
BigQueryDifferent nameIFNULL(expr, null_result)COALESCE also works.BigQuery docs

Behavior differences to check

Examples

Show a placeholder for missing regions

Oracle
SELECT customer_id, NVL(region, 'unknown') AS region FROM customers;
Snowflake
SELECT customer_id, NVL(NULLIF(region, ''), 'unknown') AS region FROM customers;
Databricks
SELECT customer_id, nvl(nullif(region, ''), 'unknown') AS region FROM customers;
BigQuery
SELECT customer_id, IFNULL(NULLIF(region, ''), 'unknown') AS region FROM customers;

Other Oracle functions

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