Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Info-Ingres] Suppressing error messages from a database procedure.

19 views
Skip to first unread message

Martin Bowes

unread,
Jan 20, 2012, 4:51:00 AM1/20/12
to Ingres and related product discussion forum

Hi All,

 

Given a directly executed procedure has a possibility of executing code which will cause an error, how do I suppress the error message?

 

I still want to trap the error code, but I want to totally handle everything that ensues from the error point.

 

Example:

create procedure trial_date_cast(

    a_string varchar(40) not null not default

)

as declare

    int_date ingresdate not null not default;

begin

    int_date = date(:a_string);

    return iierrornumber;

end;

 

If I then execute procedure trial_date_cast(a_string = 'not a date')\g

Executing . . .

 

E_US10CE 'not a date' is not a valid date/time value.

 

Ideas?

 

Martin Bowes

Roy Hann

unread,
Jan 20, 2012, 5:47:52 AM1/20/12
to
Did we not go over very similar ground in the "Error handling in DBPs"
thread I started on October 17 2005?

Contrary to what the documentation seemed to say (then), there are some
errors that terminate the DBP before it can catch and handle the
error. I don't think we ever came up with an explanation nor a
workaround.

The example in that thread was divide-by-zero.

--
Roy

UK Ingres User Association Conference 2012 will be on Tuesday June 19 2012.
The latest information is available from www.uk-iua.org.uk.


0 new messages