Subject Re: [firebird-support] Re: Instead-Of-Tigger on view causes infinite loop (probably in the engine!)
Author Martijn Tonies
Sidenote...

> I've also noticed that removing the line
> insert into "Ingredient" ...
> solves the problem (but the trigger does not do anything useful anymore!).
>
> If it may be useful, the view is defined in this way:
>
> CREATE VIEW "IngredientView" (
> "Code",
> "CurrentVersion",
> "LastUpdateAuthor",
> "LastUpdateTimestamp",
> "StateID",
> "TypeID",
> "Peq",
> "Insat",
> "Acq",
> "Me",
> "Face",

Did you know that if you remove those double quotes, you
don't have to use them anywhere?

> "Fohe",
> "Cost",
> "Description")
> AS
> SELECT
> E."Code",
> E."CurrentVersion",
> E."LastUpdateAuthor",
> E."LastUpdateTimestamp",
> E."StateID",
> I."TypeID",
> I."Peq",
> I."Insat",
> I."Acq",
> I."Me",
> I."Face",
> I."Fohe",
> I."Cost",
> EV."Description"
> FROM "Element" E
> INNER JOIN "ElementVersion" EV
> ON E."Code" = EV."Code" AND E."CurrentVersion" = EV."Version"
> INNER JOIN "Ingredient" I
> ON EV."ID" = I."ID"
> WHERE
> (E."StateID" = 1 or E."StateID" = -1)
> AND
> (SELECT "View" FROM "GetPrivileges" (E."Code", current_user)) <>
0;
>

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com