PL/SQL Ltrim

The Ltrim function removes characters from the left-hand side of an expression. Ltrim syntax LTRIM( expression, [ trim_expression ] ) Ltrim example select ltrim(‘ example’) from dual; Result: example select ltrim(‘000function’, ‘0’) from dual; Result: function select ltrim(‘123SQL’, ‘123’) from dual; Result: SQL select ltrim(‘123123SQL123’, ‘123’) from dual; Result: SQL123 select ltrim(‘XYZxyzTest’, ‘XYZ’) from dual;…(Continue Reading)

PL/SQL Rpad

The RPAD function returns an right padded expression to a specified length with the specified characters. Rpad syntax RPAD( expression, length, [ pad_expression ] ) Rpad example select rpad(‘learn’, 5) from dual; Result: learn select rpad(‘learn’, 3) from dual; Result: lea select rpad(‘learn’, 6,’0′) from dual; Result: learn0 select rpad(‘learn’, 7,’0′) from dual; Result: learn00…(Continue Reading)

PL/SQL Lpad

The LPAD function returns an left padded expression to a specified length with the specified characters. Lpad syntax LPAD( expression, length, [ pad_expression ] ) Lpad example select lpad(‘function’, 8) from dual; Result: function select lpad(‘function’, 8) from dual;ect chr(66) from dual; Result: fun select lpad(‘function’, 9,’0′) from dual; Result: 0function select lpad(‘function’, 10,’0′) from…(Continue Reading)

PL/SQL Chr

The Chr function is the opposite of the ascii function and returns the character based on the number. Chr syntax CHR ( number ) Chr example select chr(65) from dual; Result: A select chr(66) from dual; Result: B select chr(67) from dual; Result: C select chr(65)|| chr(66) || chr(67) from dual; Result: ABC select chr(97)||…(Continue Reading)

PL/SQL Extract

The PL/SQL EXTRACT function is a powerful tool that allows developers to extract a specific part of a date or timestamp value in Oracle databases. It is a built-in function in Oracle’s PL/SQL language and is used to retrieve individual components such as year, month, day, hour, minute, and second from a given date or…(Continue Reading)