Subject Re: Some explanations Needed
Author Adam
--- In firebird-support@yahoogroups.com, "women_lover_best"
<talbronstien@g...> wrote:
> Hi,
> when we use generator,why do we use syntax like..
> if new.id=null
> new.id=gen(x,1)..why not just use 2nd line?

Because if I tell the database to use ID 500, then I am probably about
to insert a record into another table with a foreign key value of 500,
but your trigger logic would change my 500 (which I got from the
generator) to 503 (for example) and I would now get a foreign key
violation. The IF condition allows the field to behave as an autoinc
(for backwards compatibility or whatever), but doesn't interfere with
the case where I may be maintaining something in a ClientDataset etc.

> Why does firebird does not have a boolean type?

To annoy us :)

Just create a domain based on char(1) that checks values are in 'T' or
'F'. From memory you use Delphi, which conveniently does the right
thing when you assign a TBooleanField to the field.

> What is the difference between time and timestamp?

Time similar concept to TTime
Timestamp similar concept to TDateTime

Time does not contain the date component wheras Timestamp does.

Adam