Subject Re: [IBO] Views
Author Helen Borrie
At 03:10 PM 05-11-01 +1300, you wrote:

>Keylinks are defined properly, and even the update statement
>generated in EditDSQL component is correct. The RowsEffected
>value is greater than 1, which is not correct, as only one record is
>updated (the updates are applied to database).

Sandeep,
You are most likely encountering a known InterBase problem with updateable views. I recall that Claudio was doing some work in this area, on Firebird, but I can't tell you right now whether he solved it.

All the same, double-check the SQL that defines your view to eliminate all doubt that the rows of your TABLE (as well as the view) might not be uniquely identified by your KeyLinks.

Elsewhere you asked for a workaround. Well, I studiously avoid updating from views. Under the BDE I used CachedUpdates but, with IBO, you have the xxxSQL properties and, IMO, these enhance the power of views. You don't even have to worry about your insert trigger because GeneratorLinks with take care of it for you. You don't even have to be concerned about flaky KeyLinks (from the updating POV, that is) provided you make sure your xxxSQL statements receive parameters to establish a unique row reference.

As for your trigger preventing users from changing values in keys, that's a crock I keep away from too. I never show keys to users. If you must show the key, then use one of the READONLY attributes or display it as an alias.

Regards,
Helen



All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________