Subject RE: [firebird-php] Re: Cannot create simple trigger???
Author Alan McDonald
I'm using this to insert a value in the key as a replacement for the
autoinsert which exist in the MySQL files I'm converting. Is this
simple method not adequate?


[Alan McDonald] The method is fine - it's just that the more sophisticated
you get, the more you might like to insert master and details records in one
hit. In MySQL you can ask for the last insert value per connection. In FB
you need to ask the server for the master key, then insert the master record
then insert the details records with the key you got as the foreign key
value. If you want to do this then you first ask the server for the key and
insert the master record by assigning the ley value to the ID field. If you
test in your trigger for NULL, then you can avoid the trigger assigning a
value when you already have one.
Alan


[Non-text portions of this message have been removed]