OREPLACE functions in Teradata can be used to replace or remove characters from a string. OREPACE is Teradata's extension to ASNI SQL. The usual REPLACE function is not available.

ANSI SQL REPLACE function

REPLACE function is commonly implemented in many other SQL databases such as SQL Server, MySQL, BigQuery, Oracle, etc.

The syntax is:

REPLACE(original_value, from_value, to_value)

For example, the following code snippet replaces word 'Context' with 'Kontext'.

SELECT REPLACE('Context is a great data engineering website.', 'Context', 'Kontext')

Teradata OREPLACE function

In Teradata, the equivalent function is OREPLACE and the syntax looks like this:

REPLACE(source_string, search_string, replace_string)

* replace_string is optional. This function replaces every occurrence of search_string in the source_string with the replace_string. Use this function either to replace or remove portions of a string.

When replace_string is not specified, it will remove search_string from source_string.

Example

SELECT OREPLACE('Context is a great data engineering website.', 'Context', 'Kontext')

info Last modified by Raymond at 2 months ago * This page is subject to Site terms.

More from Kontext

local_offer teradata local_offer python

visibility 222
thumb_up 0
access_time 2 months ago

Pandas is commonly used by Python users to perform data operations. In many scenarios, the results need to be saved to a storage like Teradata. This article shows you how to do that easily using JayDeBeApi or  ...

open_in_new View open_in_new Spark + PySpark

local_offer teradata local_offer SQL

visibility 29
thumb_up 0
access_time 2 months ago

In SQL Server, we can use TRUNCATE statement to clear all the records in a table and it usually performs better compared with DELETE statements as no transaction log for each individual row deletion. The syntax looks like the following: TRUNCATE TABLE { database_name.schema_name.tab...

open_in_new View open_in_new Code snippets

local_offer teradata local_offer python local_offer Java

visibility 135
thumb_up 0
access_time 2 months ago

Python JayDeBeApi module allows you to connect from Python to Teradata databases using Java JDBC drivers. In article Connect to Teradata database through Python , I showed ho...

open_in_new View open_in_new Python Programming

local_offer pyspark local_offer spark-2-x local_offer teradata local_offer SQL Server

visibility 618
thumb_up 0
access_time 3 months ago

In my previous article about  Connect to SQL Server in Spark (PySpark) , I mentioned the ways t...

open_in_new View open_in_new Spark + PySpark

info About author

Dark theme mode

Dark theme mode is available on Kontext.

Learn more arrow_forward

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.


Learn more arrow_forward