Subject Re: [firebird-support] Autogenerate template procedures (IBExpert)
Author Martijn Tonies
Tim,

> 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.
>

Sure there are tools to do this... Guess which one :-)

Database Workbench - part of the "Create SUID Procedures".

Check: http://www.upscene.com/documentation/dbw/tools_suidprocedures.htm
This one is a "Insert/Update Procedure"

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com