Subject Re: [firebird-support] Re: A error of too many concurrent execution of the same request on a trigger
Author Helen Borrie
At 08:03 PM 29/11/2011, ibmcom2011 wrote:
>heLen,
>
>Thanks.
>
>I found I should add a "with check option" to the end of a updatable view in the introduction of FB2.0. Now my FB version is 2.5.
>
>But the option requires a where sub-clause, and I don't know how to do.

Do you have a WHERE clause in the view? If not, WITH CHECK OPTION is not valid.

What WITH CHECK OPTION will do is prevent the user from updating the column (or columns) used in the WHERE filter.

But for the view for the purpose described, you should leave it unfiltered and apply a WHERE clause to it when you access it in the table trigger.


>And Now, I have a suppose on my trigger. For the Column YE is not be updated by user (it is non-visible for users), I want to strict the execution condition of the trigger through the Column. But how to write the condition?
>
>if (updating or (deleting)) then

A test for modification would be invalid for (deleting).

>begin
> /* if YE is modified then leave .... */

if (updating) then
begin
if (old.YE is distinct from new.YE) then
begin
/* do nothing */
end
else
begin
/* do what you intended */
...
end
end
./h