PL/SQL To_number

The TO_NUMBER function converts a TEXT expression to a number. To_number syntax TO_NUMBER( text, [ format_mask ], [ nls_params ] ) To_number example select to_number(‘1234.82’, ‘9999.99’) from dual; Result: 1234.82 select to_number(‘1234.82’, ‘9999.00’) from dual; Result: 1234.82 select to_number(‘389’, ‘999’) from dual; Result: 389 select to_number(’74’, ’99’) from dual; Result: 74 select to_number(‘-$17,107.28’, ‘$99,999.99’) from…(Continue Reading)

PL/SQL To_char

The TO_CHAR function converts a number or date to a varchar2. To_char syntax TO_CHAR( value, [ format_mask ], [ nls_param ] ) To_char example select to_char(2015.82, ‘9999.99’) from dual; Result: 2015.82 select to_char(2015.82, ‘9999.999’) from dual; Result: 2015.820 select to_char(2015.82, ‘$9,999.00’) from dual; Result: $2,015.82 select to_char(sysdate, ‘yyyy/mm/dd’) from dual; Result: 2014/12/26 select to_char(sysdate, ‘MON…(Continue Reading)

PL/SQL To_date

One of the important functions in PL/SQL is the TO_DATE function, which converts a character string representation of a date and time to an actual date value. Syntax The syntax of the TO_DATE function is as follows: TO_DATE(char, fmt, [nlsparam]) Here, char: A string or character expression that represents a date or timestamp. fmt: The…(Continue Reading)

PL/SQL NVL

The NVL function is a built-in function in Oracle PL/SQL that allows you to substitute a value for a null value. The PL/SQL NVL function replace a null expression with other expression. This can be useful when you want to ensure that all values in a column are not null, for example. NVL syntax The…(Continue Reading)

PL/SQL Substr

The Oracle PL/SQL Substr function is used to extract a substring from a string. The syntax of the function is: Substr syntax SUBSTR (source_string , start_position, substring_length) where – source_string is the original string – start_position is the position in the original string where the substring starts – length is the number of characters in…(Continue Reading)