Oracle REPLACE Function Introduction

Source: Internet
Author: User

The Oracle Replace function replaces a value in a string with a different value.

For example, you can replace each occurrence of a letter with a matching number. The format of REPLACE is as follows:

REPLACE (char, search_string [, replace_string]) if the value of the replace_string variable is not specified, it is deleted when the value of the search_string variable is found. The input can be any character data type--char, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.

Here is the SQL and execution result after using the Replace function:

Select Replace('0123456789','0','a') fromDual--a123456789Select Replace('0123456789','0',"') fromDual--123456789Select Replace('0123456789','0') fromDual--123456789

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.