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 -> Re: Querying Oracle Errors

Re: Querying Oracle Errors

From: <markp7832_at_my-deja.com>
Date: Tue, 14 Dec 1999 15:17:08 GMT
Message-ID: <835n1f$637$1@nnrp1.deja.com>


In article <38557623.99ED2A49_at_students.bbk.ac.uk>,   Sam Ricketts <amerc01_at_students.bbk.ac.uk> wrote:
>
> Am a beginner in oracle, and am doing some work which I need to
> retrieve some errors messages. I need to capture these errors before
> they actually occur, I cannot however raise all these errors on the
> server.
>
> Any help on which DLL, or data view one can query to retrieve
> other details on oracle errors.
>
> Sam
>

I am not sure this is what you want but:

On UNIX systems you have a utility oerr that will provide some error message help:
seqdev 6 % oerr ora 01027
01027, 00000, "bind variables not allowed for data definition operations"
// *Cause: An attempt was made to use a bind variable in a SQL data definition
// operation.
// *Action: Such bind variables are not allowed.

In SQL*Plus you can use a routine like this to get error information: set echo off
rem
rem Pl/sql script to create procedure to report Oracle error messages rem in sqlplus
rem
rem Note - you can in sqlplus issue:

rem       set serveroutput on
rem       execute dbms_output.put_line(sqlerrm(-01017))
rem
rem --------------------------------------------------------------------
--
rem 1996 07 11 m d powell New script. rem 1998 06 23 m d powell Modify to be in-stream procedure from stored
rem
set feedback off
set serveroutput on
set verify off
accept err_code prompt "Enter Oracle Error Number, i.e, ORA-00100 = 100 ==> "
declare
procedure ora_error (
  v_err_no in number
  )
is
v_rc       number              ;
v_msg      varchar2(100)       ;

--
begin
if v_err_no > 0 then
  v_rc := v_err_no * -1 ;
else
  v_rc  :=  v_err_no           ;
end if                         ;
v_msg  :=  sqlerrm(v_rc)       ;
dbms_output.put_line(v_msg)    ;
end ora_error                  ;

--
begin
 ora_error(&err_code);
end;
/
set feedback on
undefine err_code

--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Dec 14 1999 - 09:17:08 CST

Original text of this message

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