Oracle tutorial : User Defined Exception in Oracle PL SQL

Veröffentlicht am: 18 Februar 2016
auf dem Kanal: Tech Query Pond
430
14

Oracle tutorial: User Defined Exception in Oracle PL SQL

pl sql exception handling
pl sql exception handling examples

This video will show you how to raise user defined exceptions in oracle.

Example:

BEGIN
IF condition THEN
RAISE exception_name;
END IF;
EXCEPTION
WHEN exception_name THEN
statement;
END;


1)We can defined exception to make your own exception.

2)This exception must be declare yourself and RAISE statement to raise explicitly.

Declare exception : user_define_exception_name EXCEPTION;

RAISE exception : RAISE user_define_exception_name;

How to use :

WHEN user_define_exception_name THEN
//User Action

lets see an example

DECLARE
exception1 EXCEPTION;
g NUMBER;
BEGIN
FOR g IN (SELECT * FROM EMPLOYEE) LOOP
IF g.ID = 7 THEN
RAISE exception1;
END IF;
END LOOP;
EXCEPTION
WHEN exception1 THEN
dbms_output.put_line(‘WE HAVE FOUND EMPLOYEE NUMBER 7’);
END;
/



Subscribe on youtube:
   / @techquerypond  

For more tutorial please visit #techquerypond

https://techquerypond.com

https://techquerypond.wordpress.com

  / techquerypond  


Auf dieser Seite können Sie das Online-Video Oracle tutorial : User Defined Exception in Oracle PL SQL mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Tech Query Pond 18 Februar 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 430 Mal angesehen und es wurde von 14 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!