|Previous Top Next|
SUID procedures - Select, Update, Insert and Delete procedures - can be very easily created by using the context menu from the Database Navigator and selecting Create SUID Procedures.
Many people use these procedures in order to avoid direct access to the database tables.
The Table context menu
A screen with the information about the procedures will be shown.
The Create SUID Procedures screen
As you can see in the above screen shot, you can select what columns to include.
UPDATE and DELETE Procedure
The UPDATE and DELETE procedures will always accept the primary key columns of the table as input parameters - of course, when doing the update, other columns need to be included as well.
If you have a Primary Key on the table that consist of a numerical datatype, Database Workbench will enable the selection of a sequence to generate a new ID number in the INSERT procedure. This number will be returned through an output parameter. The sequence will only be used if the input parameter is NULL or zero.
With the combined INSERT/UPDATE procedure, you can generate a single procedure that allows you to either insert a new row, or update an existing row if a primary key violation is generated. Note that this INSERT procedure will not let you automatically generate a new ID number from a sequence and requires valid values for the primary key columns.