Subject error attempted update of read-only column creating a trigger
Author Didier Gasser-Morlay
Hi,

I am puzzled by the following error message. I am porting a database
from 1.5 to 2.0.1 and when creating the following trigger:

SET TERM ^ ;
CREATE TRIGGER EMPLOYEE_BI0 FOR EMPLOYEE ACTIVE
BEFORE INSERT POSITION 0
AS
begin
if (new.username is not null) then
if (exists (select * from vlogin where vlogin.username =
new.username)) then
exception USERNAME_EXISTS;
end^
SET TERM ; ^



I get the following error message (using Flamerobin):
*** IBPP::SQLException ***
Context: Transaction::Commit

SQL Message : -151
This column cannot be updated because it is derived from an SQL
function or expression.

Engine Code : 335544359
Engine Message :
attempted update of read-only column

Note: vlogin is a view on two tables:
employees and contacts and return for each table the user name and
passwords via a union

I am not sure that this message makes a lot of sense

Didier