Subject | Re: [firebird-support] Error Handling |
---|---|
Author | Martijn Tonies |
Post date | 2006-05-31T08:19:54Z |
Hello Alberto,
Statements execute BEFORE the exception, but inside the same BEGIN..END
block will be rolled back.
Execution will proceed to the next exception handler block, if there's none
available, the exception will be thrown to the caller (either another
procedure,
trigger, or the client).
That means, if there's no exception handler at all, all changes will be
undone.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> What happen if something go wrong in a store procedure with this body?Statements after the statement that caused the error will not be executed.
Statements execute BEFORE the exception, but inside the same BEGIN..END
block will be rolled back.
Execution will proceed to the next exception handler block, if there's none
available, the exception will be thrown to the caller (either another
procedure,
trigger, or the client).
That means, if there's no exception handler at all, all changes will be
undone.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> If an error occur in point A or B. The rest of procedure is executedhowever?
> It's correct after any INSERT, UPDATE, DELET use row_count? Or how canmake atomic the body of store procedure
>
> begin
> ...
> number = gen_id(gen_number_id, 1);
>
> /* point A */
>
> insert into acquisti_riga (.....) values ( number......);
>
> update ... set ... = ... + 1 where .... = .... and ... = ....;
>
> /* point B */
>
> execute procedure mov_ins(....);
> ....
> end