Subject Re: [firebird-support] Setting value from stored proc in trigger
Author Martijn Tonies
Hello Daniel,

> I'm looking for the correct syntax to set a field in a trigger to a
> value retrieved from a
> stored procedure.
>
> Here's a simplified examle (I'm not doing multiplication, but some other,
more
> complex calculations):
>
> create procedure multiply(a integer, b integer) returns(c integer) as
> begin
> c = :a*:b;
> end^
>
> create trigger test_trigger for test active before insert as
> begin
> new.field = multiply(10,20); /* I'm looking for the correct syntax
> to do this */
> end^

A procedure is not a function.

execute procedure multiply (10, 20) returning_values :new.field;

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com