Subject RE: [firebird-support] Autogenerate template procedures (IBExpert)
Author Alan McDonald
>
> Are there features in firebird or IBExpert to simplify common
> tasks such as creating a stored procedure to add or update a
> field in a table.
>
> I am getting somewhat bored writing code like this where the same
> field name is repeated five times (plus the a few times on the
> calling side)
>
> CREATE PROCEDURE SP_ITEM_ADD (
> IITEM_ID INTEGER,
> SNAME VARCHAR(50))
> AS
> begin
> INSERT INTO T_ITEMS
> (ITEM_ID, NAME)
> VALUES (:IITEM_ID, :SNAME);
> when sqlcode -803 do --errorcode "no duplicate value"
> UPDATE T_ITEMS
> set name = :SNAME,
> where ITEM_ID = :IITEM_ID;
> End
>
> Are there tools to generate this or is there a better way than
> writing it all? This is esentially a procedure adding all data to
> a row in a table based on the primary key.
>
> Tim
>

IBExpert will do this no worries.
You can setup templates and just go for it.
Alan