Subject | Error using query with updatable view |
---|---|
Author | |
Post date | 2018-01-04T13:31:01Z |
Hi all, and best wishes for the new year of 2018!
I use Windows FB 2.5, Delphi 2007, IBO 5.5.5 2152.
With an updatable view (2 tables joined in 1 view, using triggers to update and delete data in both tables), I create a simple TIB_Query on a data module and add select * from myview, and click Generate For Table to auto-generate update/insert/delete sql code; this works fine just as with a simple table.
However, opening this TIB_Query cause “Invalid customer DML column reference RDB$DB_KEY”. It seems Firebird SQL does not have a RDB$DB_KEY in a view, which is logical, since it refers to 2 tables.
I use Windows FB 2.5, Delphi 2007, IBO 5.5.5 2152.
With an updatable view (2 tables joined in 1 view, using triggers to update and delete data in both tables), I create a simple TIB_Query on a data module and add select * from myview, and click Generate For Table to auto-generate update/insert/delete sql code; this works fine just as with a simple table.
However, opening this TIB_Query cause “Invalid customer DML column reference RDB$DB_KEY”. It seems Firebird SQL does not have a RDB$DB_KEY in a view, which is logical, since it refers to 2 tables.
Using a third party DB tool "Database Workbench", I can view and edit rows without any problem, so the view is sound.
Now, how can I get this to work in IBObjects?
I did try to turn off Keylinks autodefine, no change. I did try to edit WHERE RDB$DB_KEY = :DB_KEY and substitute with the primary key column, no change. I did try to add the primary key column to KeyLinks, no change.
So, in short, is it possible to use TIB_Query for view/insert/update/delete with an updatable view?
Thanks in advance,
Thomas