Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Effect of errors in a table procedure
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Martin Bowes  
View profile  
 More options Jan 20, 6:15 am
Newsgroups: comp.databases.ingres
From: Martin Bowes <martin.bo...@ctsu.ox.ac.uk>
Date: Fri, 20 Jan 2012 11:15:22 +0000
Local: Fri, Jan 20 2012 6:15 am
Subject: [Info-Ingres] Effect of errors in a table procedure

Hi All,

In a DEP if an error occurs then a certain set of events occur. Things like:

*         no byref parameters are updated,

*         a rollback of all statements upto the error occurs,

*         execution recommences from the first statement after the one which produces the error.

So in a Row producing or Table procedure what should happen?

What if I've already generated some rows?

create procedure is_date(
    a_string varchar(40) not null not default
)
result row myrow (is_date integer not null)
as declare
    int_date ingresdate not null not default;
    int_string varchar(40) not null not default;
    a_date   integer not null not default;
begin
    for select :a_string into :int_string
    do
        int_date = date(:a_string);
        select iierrornumber into :a_date;
        return row (:a_date);
    endfor;
end;
\p\g
declare global temporary table x_date(
    a_string    varchar(40) not null not default
    ) on commit preserve rows with norecovery;
insert into x_date(a_string) values('1/1/2011 11:13:45');
insert into x_date(a_string) values('1/11/2010');
insert into x_date(a_string) values('not a date');
insert into x_date(a_string) values('31/1/2002');
\p\g
select x.a_string, y.is_date
from x_date x, is_date(a_string = x.a_string) y
\p\g

On execution this will produce:
E_US10CE 'not a date' is not a valid date/time value.
E_QE0018 Illegal parameter in control block.

What do people think should happen here?

Marty


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roy Hann  
View profile  
 More options Jan 20, 6:32 am
Newsgroups: comp.databases.ingres
From: Roy Hann <specia...@processed.almost.meat>
Date: Fri, 20 Jan 2012 11:32:19 +0000 (UTC)
Local: Fri, Jan 20 2012 6:32 am
Subject: Re: [Info-Ingres] Effect of errors in a table procedure

Martin Bowes wrote:
> Hi All,

> In a DEP if an error occurs then a certain set of events occur. Things like:

> *         no byref parameters are updated,

> *         a rollback of all statements upto the error occurs,

> *         execution recommences from the first statement after the one which produces the error.

> So in a Row producing or Table procedure what should happen?

> What if I've already generated some rows?

[snip]

> On execution this will produce:
> E_US10CE 'not a date' is not a valid date/time value.
> E_QE0018 Illegal parameter in control block.

> What do people think should happen here?

Atomic fail.  End of.  

--
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »