dbTalk Databases Forums  

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

comp.databases.ingres comp.databases.ingres


Discuss [Info-Ingres] Suppressing error messages from a database procedure. in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Bowes
 
Posts: n/a

Default [Info-Ingres] Suppressing error messages from a database procedure. - 01-20-2012 , 03:51 AM






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

Reply With Quote
  #2  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] Suppressing error messages from a database procedure. - 01-20-2012 , 04:47 AM






Martin Bowes wrote:

Quote:
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?
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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.