Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Raise my exception with ORA-code (?)

Raise my exception with ORA-code (?)

From: Corvax <corvax_kg_at_my-deja.com>
Date: Wed, 15 Nov 2000 08:53:33 GMT
Message-ID: <8utiub$nhm$1@nnrp1.deja.com>

Hi, all!
I'd like to raise exception with ORA-code in PL/SQL block. Here is my source code:
declare
  parent_key_not_found EXCEPTION;
  PRAGMA EXCEPTION_INIT (parent_key_not_found, -2291); begin

  raise parent_key_not_found;
end;
But here is some problem: the exception string is "ORA-02291: integrity constraint (.) violated - parent key not found" and there is nothing between the brackets. I have to check parent key existing in PL/SQL block, that's why I need your help.
The question is "How to put table name and column name between the brackets". Are there some variables in system Oracle packages that control this information between the brackets? I have to make this without integrity constraint.

It could be released by raise_application_error, but the code would not be the same as -2291. Is it possible to release it with just raise?

Thanks in advance.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Nov 15 2000 - 02:53:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US