Announcement

Collapse
No announcement yet.

Exception in einer SP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception in einer SP

    Hallo

    ich habe für meine DB einen SP programmiert welche auch schon funktioniert wenn alles vorhanden ist (Tabellen, usw.).
    Was mir jetzt noch fehlt ist die Excetpion- Behandlung, sollte mal etwas fehl schlagen.
    Meine Frage wäre jetzt, wie ich dieses Exception- Handling in einer SP für eine Oracle DB mache - Ich möchte den ganzen Code innerhalb von BEGIN ... END; mit dem Exception- Handling abfangen.
    Weiß jemand wie das am Besten machen kann?

    Vielen Dank,
    lg
    PollerJava


    Code:
    CREATE OR REPLACE PROCEDURE NamederSP
      AS
        declarationen
      BEGIN
          /* hier beginn des Exception- Handlings */
           programmcode
          /* hier ende des Exception- Handlings */
      END;

  • #2
    In diesem Fall musst Du einen weiteren BEGIN END Block einfügen:

    Code:
    BEGIN
    ...
       BEGIN
       ...
       EXCEPTION
       ....
       END;
    ...
    END;
    Dim
    Zitat Tom Kyte:
    I have a simple philosophy when it comes to the Oracle Database: you can treat it as a black box and just stick data into it, or you can understand how it works and exploit it as a powerful computing environment.

    Comment

    Working...
    X