In the PL/SQL language the errors are called exceptions. Exceptions can be predefined exceptions (internal error) or user defined exceptions (named by user). Predefined PL/SQL Exceptions The predefined exceptions are internally defined exceptions that have predefined names like no_data_found, too_many_rows, others, invalid_number, zero_divide. The predefined PL/SQL exceptions are declared globally in the package STANDARD and…(Continue Reading)
Category: PL/SQL
Learn PLSQL Tutorial
PL/SQL Rtrim
The Rtrim function removes characters from the right-hand side of an expression. Rtrim syntax RTRIM( expression, [ trim_expression ] ) Rtrim example select rtrim(‘example ‘) from dual; Result: example select rtrim(‘000function000’, ‘0’) from dual; Result: 000function select rtrim(‘PHP123’, ‘123’) from dual; Result: PHP select rtrim(‘123PHP123123’, ‘123’) from dual; Result: 123PHP select rtrim(‘TestxyzXYZ’, ‘XYZ’) from dual;…(Continue Reading)
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)