Oracle common character functions-Translate

Source: Internet
Author: User
Oracle common character function: Translate. the return value replaces each character in from with the corresponding character in to. If from is longer than to, it is more than to in from.

Oracle common character function: Translate. the return value replaces each character in from with the corresponding character in to. If from is longer than to, it is more than to in from.

Syntax: TRANSLATE (char, from,)

Usage: replace each character in The from statement with the corresponding character in the to statement. If the from statement is longer than the to statement, the strings in the from statement are deleted. One of the three parameters is null, And the return value is also null.

Example:

Select translate ('abcdefga ', 'abc', 'wo') from dual;

Analysis: This statement converts 'abc' in 'abcdefga 'to 'wo'. Because 'A' in 'abc' corresponds to 'w' in 'Wo ', therefore, 'A' in 'abcdefga 'is converted to 'w', while' B 'in 'abc' corresponds to 'O' in 'Wo ', therefore, 'B' in 'abcdefga 'is converted to 'O', and 'C' in 'abc' does not have the corresponding character in 'Wo, delete all 'C' in 'abcdefga;

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.