Subject | Re: [firebird-support] triggers not working |
---|---|
Author | Thomas Steinmaurer |
Post date | 2005-02-16T12:44:16Z |
Hi,
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com
> I've got a trigger that doesn't seem to be firing. Two tables - oneYour trigger needs to be a BEFORE INSERT trigger.
> with barcodes, one with products. On the products table, I have a
> trigger that after insert, grabs an unallocated barcode and assigns it
> to the new product.
>
> select first 1 b.code_check, b.barcode from barcode_upca b where
> b.used = 0 into new.isbn_check, new.barcode;
> UPDATE barcode_upca b SET b.used = 1 WHERE b.code_check = new.isbn_check;
>
> I'm aware that this is not going to work very well in a multiuser
> situation, but why doesn't it populate the values? It doesn't seem to
> work from IBExpert or my Delphi app using IBObjects.
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com