Subject | Re: [firebird-support] Non null column, before insert trigger not filling column, Delphi |
---|---|
Author | Martijn Tonies |
Post date | 2010-06-15T10:32:57Z |
Hello Mike,
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
> I have an 'ID' INTEGER column without a non-null constraint. The table hasThe trigger does fill it, this message is coming from Delphi, not Firebird.
> a BEFORE INSERT trigger that executes the generator that fills the column.
> When I post a new record the trigger fires and creates the ID column value
> correctly.
>
> However, if the 'ID' column has a non-null constraint when I post I get an
> error: 'Column ID must have a value'.
>
> I would have expected the trigger to have filled the column but apparently
> the constraint checking takes precedence.
> Is this foreseen, that is, is this normal or is this a bug?Normal if your TField definition has the Required property set to True.
> Obviously, I could simply take off the non-null constraint but I amSee above.
> converting to Firebird with rougly 50 tables, each with a ID column of
> this type, so I would have to edit 50 table definitions.
>
> Can anyone clarify theis situation?
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com