[firebird-support] Identity vs Before Insert Trigger

2019-10-31 Thread Rustam rusta...@ukr.net [firebird-support]
As i understand your question - yes. BI trigger fired before column constraints check. To allow you process and correct row to store without errors. Execution sequence: BI trigger -> default values -> not null -, FK-, check- constraints ->  record storing -> AI triggers. However, the same quer

Re: [firebird-support] Identity vs Before Insert Trigger

2019-10-31 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-10-31 15:32, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] wrote: > 31.10.2019 15:15, Daniel Miller dmil...@amfes.com [firebird-support] > wrote: >> My question - is this intended behavior? > >For "generated *by default*" it is intended behavior. Your trigger > obviously e

Re: [firebird-support] Identity vs Before Insert Trigger

2019-10-31 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
31.10.2019 15:15, Daniel Miller dmil...@amfes.com [firebird-support] wrote: > My question - is this intended behavior? For "generated *by default*" it is intended behavior. Your trigger obviously emulated identity with "generated always" option. -- WBR, SD. ---

[firebird-support] Identity vs Before Insert Trigger

2019-10-31 Thread Rustam rusta...@ukr.net [firebird-support]
For my previous message: and if you do not correct 'null' value in BI trigger, next you get an 'validation error'.

Re: [firebird-support] Identity vs Before Insert Trigger

2019-10-31 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-10-31 15:15, Daniel Miller dmil...@amfes.com [firebird-support] wrote: > The fault or misunderstanding is probably mine, but: > > I thought the "identity" definition was functionally the same as the > before-insert with generator. Particularly with regards to handling > null > values dur

[firebird-support] Identity vs Before Insert Trigger

2019-10-31 Thread Daniel Miller dmil...@amfes.com [firebird-support]
The fault or misunderstanding is probably mine, but: I thought the "identity" definition was functionally the same as the before-insert with generator. Particularly with regards to handling null values during inserts. However, given: create table TEST1 ( TEST_ID integer generated by defaul