The TRANSLATE function replaces a single character with another character. Translate syntax TRANSLATE( string, string_to_replace, replacement_string ) Translate example select translate(‘7test721’, ‘721’, ‘834’) from dual; Result: 8test834 select translate(‘111sql4156’, ‘1’, ‘3’) from dual; Result: 333sql4356 select translate(‘oradev’, ‘dev’, ‘cle’) from dual; Result: oracle select translate(‘database 1’, ‘1’, ‘2’) from dual; Result: database 2
Author: Dev
PL/SQL Replace
The REPLACE function replaces a set of characters in a string with another set of characters. The Oracle PL/SQL Replace function is used to replace all occurrences of a specified string with another string in a given string. Replace syntax The syntax for the Replace function is as follows: REPLACE( string, string_to_replace, [ replacement_string ]…(Continue Reading)
PL/SQL Trunc
The Oracle PL/SQL TRUNC function is used to truncate a numeric value to a specified number of decimal places. It takes two arguments: the first argument is the numeric value to be truncated, and the second argument is the number of decimal places to truncate the value to. Syntax The syntax of the TRUNC function…(Continue Reading)
PL/SQL Trim
The Trim function enables you to remove all specified characters from the start or from the end of a string. Trim syntax TRIM( [ leading | trailing | both [ trim_character ] ] string ) Trim example select trim(‘ PL/SQL ‘) from dual; Result: PL/SQL select trim(leading ‘0’ from ‘0012300’) from dual; Result: 12300 select…(Continue Reading)
PL/SQL Round
The ROUND function is a built-in function in Oracle’s PL/SQL programming language that is used to round a numeric value to a specified number of decimal places or to the nearest integer. The PL/SQL ROUND function can be used to round off a date value to a specified format. This function takes two arguments: the…(Continue Reading)