How to Handle Errors in PL/SQL
In this article I am going to explain how to handle errors in PL/SQL.
PL/SQL is define as procedure language structure query language. PL/SQL is developed by oracle. PL/SQL supports many feature like variables, loops, conditions and exceptions. It also support the concept of array. In present time PL/SQL is integrated component of oracle software. SQL provide limited support for advance programming and PL/SQL fill this gap.
Block is a basic unit of a PL/SQL application. This block is collection of PL/SQL statements grouped as logical unit. Using PL/SQL blocks you can create five different type of program units.
- Stored Function
- Stored procedure
- Anonymous Block
An exception is the pre defined or user defined application error that arises during the execution of a program. Exceptions are nothing it is an abnormal condition. To handle these error or abnormal condition known as exception handling. In PL/SQL we can handle errors that raises by PL/SQL program.
Example of While Loop Statement
select * into st_rec FROM student where s_id=2;
when TOO_MANY_ROWS THEN
when others then