"Exception Handling in PL/SQL | PL-SQL Full Course Tutorial 2023
#plsqlexceptionhandling #plsqlexception #exceptionhandling #plsqlhandling #plsqlbasics #plsqlprocedures #plsqlcursor #plsqlfunctions #plsqltriggers #plsqlvssql #oracleplsql #PLSQLtutorialforbeginners #PLSQLtutorialinenglish #plsqlinterview #plsqlinenglish #parnikatutorials #plsql2023 #plsqlfullcourse2023 #plsqlfullcrashcourse2023 #plsqlcrashcourse #plsqlcourse2023
previous video link - Parameterized Cursors in PL/SQL | PL/SQL Cursor with Parameters
• Cursor Parameters in PLSQL | Paramete...
01:12 - runtime error
03:10 - types of exception
04:10 - syntax of an exception
06:35 - syntax defined exception
07:34 - named system exception
08:06 - named system exceptions
23:02 - value underscore error exception
28:34 - o underscore divide exception
32:31 - unnamed system exception
33:20 - unnamed exception
38:41 - user defined exception
39:52 - user defined exception"
In this video, I have discussed Exception Handling in PL/SQL
#exceptionhandling #parnikatutorials #plsql
An exception is an error which disrupts the normal flow of program instructions. PL/SQL provides us the exception block which raises the exception thus helping the programmer to find out the fault and resolve it.
There are two types of exceptions defined in PL/SQL
User defined exception.
System defined exceptions.
Syntax to write an exception
WHEN exception THEN
statement;
ECLARE
declarations section;
BEGIN
executable command(s);
EXCEPTION
WHEN exception1 THEN
statement1;
WHEN exception2 THEN
statement2;
[WHEN others THEN]
/* default exception handling code */
END;
When other keyword should be used only at the end of the exception handling block as no exception handling part present later will get executed as the control will exit from the block after executing the WHEN OTHERS.
System defined exceptions:
These exceptions are predefined in PL/SQL which get raised WHEN certain database rule is violated.
System-defined exceptions are further divided into two categories:
Named system exceptions.
Unnamed system exceptions.
Named system exceptions: They have a predefined name by the system like NO_DATA_FOUND, TOO_MANY_ROWS, VALUE_ERROR etc. the list is quite big.
NO_DATA_FOUND: It is raised WHEN a SELECT INTO statement returns no rows.
TOO_MANY_ROWS: It is raised WHEN a SELECT INTO statement returns more than one row.
VALUE_ERROR:This error is raised WHEN a statement is executed that resulted in an arithmetic, numeric, string, conversion, or constraint error. This error mainly results from programmer error or invalid data input.
ZERO_DIVIDE : It raises exception WHEN dividing with zero.
Unnamed system exceptions:Oracle doesn’t provide name for some system exceptions called unnamed system exceptions.These exceptions don’t occur frequently.These exceptions have two parts code and an associated message.
The way to handle to these exceptions is to assign name to them using Pragma EXCEPTION_INIT
Syntax:
PRAGMA EXCEPTION_INIT(exception_name, -error_number);
error_number are pre-defined and have negative integer range from -20000 to -20999.
User defined exceptions:
This type of users can create their own exceptions according to the need and to raise these exceptions explicitly raise command is used.
Social media Links:
Instagram: / parnikatutorials
Website: http://parnikatutorials.in/
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin: / parnika-tutorials-a8a9831b2
Pinterest: / parnikatutorials0892
Playlists:
Virtual Coffee with Jagadeesh:
• VIRTUAL COFFEE WITH JAGADEESH
Digital Logic Design:
• Digital Logic Design
Computer Organization and Architecture:
• ABOUT PARNIKA TUTORIALS
C Programming:
• L 1: WHAT IS AN ALGORITHM AND CHARACT...
Data Structures:
• L 1: Uncover the Benefits of Linked L...
Theory of Computation:
• ABOUT PARNIKA TUTORIALS
Compiler Design:
• ABOUT PARNIKA TUTORIALS
Operating Systems: • PROCESS STATE DIAGRAM | LONG TERM, SH...
Databases: • ABOUT PARNIKA TUTORIALS
Computer Networks:
• ABOUT PARNIKA TUTORIALS
For GATE PYQs and much more explore:
/ parnikatutorials