Subject Re: [firebird-support] "Request depth exceeded" error
Author Ivan Prenosil
From: "Bob Murdoch"
> I just started receiving the error message 'Request depth exceeded
> (Recursive function?)' on my database for the first time. Doing a
> newsgroup search, I see that this error is generated when running large
> scripts with a lot of FK definitions, or during a gbak restore.
> However, this error is occuring during a normal stored procedure call that
> has absolutely no recursion in it. It seems to be only this one stored
> procedure, which is called as part of an after insert trigger to summarize
> a batch of data that was just imported. I have tried to run a couple of
> the other sp's that are called from this trigger, and they are running
> correctly.

Are you absolutely sure there is not any hidden/indirect recursion, like

you insert row ->
it will activate trigger ->
in the trigger you call SP ->
SP updates some rows ->
it will activate update trigger ->
the tigger will
insert row ->

Also do not forget that CASCADE clause can be involed too ...