X
ďťż

CH08_02

Lemur zaprasza

[Chapter 8] 8.2 The Exception SectionChapter 8Exception Handlers 8.2 The Exception SectionA PL/SQL block (of which procedures, functions, and anonymous blocks are all instances) consists of up to four parts: the header, declaration section, execution section, and exception section, as shown in the following anonymous block: DECLARE
... declarations ...
BEGIN
... executable statements ...
[ EXCEPTION
... exception handlers ... ]
END;When an exception is raised within the execution section of a PL/SQL block, control passes to the exception section. PL/SQL then scans through the exception handlers to see if that exception is handled. The syntax for an exception section follows: EXCEPTION
WHEN exception_name [ OR exception_name ... ]
THEN
<executable statements>
END;You can have multiple exception handlers in a single exception section. The exception handlers are structured much like a conditional CASE statement, as shown below: The Exception Section An English-like Translation EXCEPTION
WHEN NO_DATA_FOUND
THEN
executable_statements1; If the NO_DATA_FOUND exception was raised, then execute the first set of statements. WHEN payment_overdue
THEN
executable_statements2; If the payment is overdue, then execute the second set of statements. WHEN OTHERS
THEN
executable_statements3;
END; If any other exception is encountered, then execute the third set of statements. An exception is handled if an exception that is named in a WHEN clause matches the exception that was raised. Notice that the WHEN clause traps errors only by exception name, not by error codes. If a match is found, then the executable statements associated with that exception are run. If the exception that has been raised is not handled or does not match any of the named exceptions, the executable statements associated with the WHEN OTHERS clause -- if present -- will be run. The WHEN OTHERS clause is optional; if it is not present, then any unhandled exception is immediately raised in the enclosing block, if any. If the exception is not handled by any PL/SQL block, then the error number and message are presented directly to the user of the application. The exception is, in other words, unhandled and it disrupts the execution of the application. 8.1 Why Exception Handling?8.3 Types of Exceptions


O'Reilly & Associates. All rights reserved.
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • teen-mushing.xlx.pl
  • Wątki
    Powered by wordpress | Theme: simpletex | © Lemur zaprasza

    Drogi uzytkowniku!

    W trosce o komfort korzystania z naszego serwisu chcemy dostarczac Ci coraz lepsze uslugi. By moc to robic prosimy, abys wyrazil zgode na dopasowanie tresci marketingowych do Twoich zachowan w serwisie. Zgoda ta pozwoli nam czesciowo finansowac rozwoj swiadczonych uslug.

    Pamietaj, ze dbamy o Twoja prywatnosc. Nie zwiekszamy zakresu naszych uprawnien bez Twojej zgody. Zadbamy rowniez o bezpieczenstwo Twoich danych. Wyrazona zgode mozesz cofnac w kazdej chwili.

     Tak, zgadzam sie na nadanie mi "cookie" i korzystanie z danych przez Administratora Serwisu i jego partnerow w celu dopasowania tresci do moich potrzeb. Przeczytalem(am) Polityke prywatnosci. Rozumiem ja i akceptuje.

     Tak, zgadzam sie na przetwarzanie moich danych osobowych przez Administratora Serwisu i jego partnerow w celu personalizowania wyswietlanych mi reklam i dostosowania do mnie prezentowanych tresci marketingowych. Przeczytalem(am) Polityke prywatnosci. Rozumiem ja i akceptuje.

    Wyrazenie powyzszych zgod jest dobrowolne i mozesz je w dowolnym momencie wycofac poprzez opcje: "Twoje zgody", dostepnej w prawym, dolnym rogu strony lub poprzez usuniecie "cookies" w swojej przegladarce dla powyzej strony, z tym, ze wycofanie zgody nie bedzie mialo wplywu na zgodnosc z prawem przetwarzania na podstawie zgody, przed jej wycofaniem.