====== pears.BoilerPlate ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Contains standard text which can be dropped into various types of note field.
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **BoilerPlateID** | char(20) | NOT NULL | | |
| Type | char(2) | NOT NULL | | |
| Description | char(30) | NOT NULL | | |
| SortOrder | integer | NULL | | |
| BoilerPlateText | long varchar | NULL | | |
===== Primary Key =====
* BoilerPlateID
===== Foreign Keys =====
* No outgoing foreign keys found.
===== Referenced By =====
^ Table ^ Constraint ^ Columns ^ Referenced columns ^
| [[database:tables:pears_boilerplatedivision|pears.BoilerPlatedivision]] | BoilerPlate | BoilerPlateid | BoilerPlateID |
| [[database:tables:pears_notificationtemplate|pears.NotificationTemplate]] | BoilerPlate | BoilerPlateID | BoilerPlateID |
===== Indexes =====
* No indexes found.
===== Triggers =====
^ Name ^ Timing ^ Event ^
| BoilerPlateDeleteAudit | after | delete order 1 |
| BoilerPlateUpdateAudit | after | update of "BoilerPlateID", "Description","Type", "BoilerPlateText" order 1 |
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."BoilerPlate"
-- Table comment: Contains standard text which can be dropped into various types of note field.
-- Statement count: 6
CREATE TABLE "pears"."BoilerPlate" (
"BoilerPlateID" char(20) NOT NULL
,"Type" char(2) NOT NULL
,"Description" char(30) NOT NULL
,"SortOrder" integer NULL
,"BoilerPlateText" long varchar NULL
,PRIMARY KEY ("BoilerPlateID" ASC)
)
go
COMMENT ON TABLE "pears"."BoilerPlate" IS
'Contains standard text which can be dropped into various types of note field.'
go
create trigger "BoilerPlateDeleteAudit" after delete order 1 on
"pears"."BoilerPlate"
referencing old as "old_Plate"
for each row
begin
call "AuditLog"('BOILERPLATE',"old_Plate"."BoilerPlateID",
'Deleted Boiler Plate',
"string"(' Type = ',"old_Plate"."Type",
', Description = ',"old_Plate"."Description",
', Order = ',"old_Plate"."SortOrder",
', BoilerPlateText = ',"old_Plate"."BoilerPlateText"),
'')
end
go
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."BoilerPlate"."BoilerPlateDeleteAudit" IS
{create trigger BoilerPlateDeleteAudit
after delete order 1 on
BoilerPlate
referencing old as old_Plate
for each row
begin
call AuditLog('BOILERPLATE', old_Plate.BoilerPlateID,
'Deleted Boiler Plate',
string(' Type = ', old_Plate.Type,
', Description = ', old_Plate.Description,
', Order = ', old_Plate.SortOrder,
', BoilerPlateText = ', old_Plate.BoilerPlateText),
'');
end
}
go
create trigger "BoilerPlateUpdateAudit" after update of "BoilerPlateID",
"Description","Type",
"BoilerPlateText" order 1 on "pears"."BoilerPlate"
referencing old as "old_Plate" new as "new_Plate"
for each row
begin
if update("BoilerPlateID") then
call "AuditLog"('BOILERPLATE',"old_Plate"."BoilerPlateID","string"('BOILERPLATE Updated - ID : ',"old_Plate"."BoilerPlateID"),"old_Plate"."BoilerPLateID","new_Plate"."BoilerPLateID")
end if;
if update("Description") then
call "AuditLog"('BOILERPLATE',"old_Plate"."BoilerPlateID","string"('BOILERPLATE Updated - Description : ',"old_Plate"."Description"),"old_Plate"."Description","new_Plate"."Description")
end if;
if update("Type") then
call "AuditLog"('BOILERPLATE',"old_Plate"."BoilerPlateID","string"('BOILERPLATE Updated - Type : ',"old_Plate"."Type"),"old_Plate"."Type","new_Plate"."Type")
end if;
if update("BoilerPlateText") then
call "AuditLog"('BOILERPLATE',"old_Plate"."BoilerPlateID","string"('BOILERPLATE Updated - BoilerPlateText : ',"old_Plate"."BoilerPlateText"),"old_Plate"."BoilerPlateText","new_Plate"."BoilerPlateText")
end if
end
go
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."BoilerPlate"."BoilerPlateUpdateAudit" IS
{create trigger BoilerPlateUpdateAudit
after update of
BoilerPlateID, Description, Type, BoilerPlateText
order 1 on pears.BoilerPlate
referencing old as old_Plate new as new_Plate
for each row
begin
if update(BoilerPlateID) then
call AuditLog('BOILERPLATE',old_Plate.BoilerPlateID,string('BOILERPLATE Updated - ID : ',old_Plate.BoilerPlateID),old_Plate.BoilerPLateID,new_Plate.BoilerPLateID)
end if ;
if update(Description) then
call AuditLog('BOILERPLATE',old_Plate.BoilerPlateID,string('BOILERPLATE Updated - Description : ',old_Plate.Description),old_Plate.Description,new_Plate.Description)
end if ;
if update(Type) then
call AuditLog('BOILERPLATE',old_Plate.BoilerPlateID,string('BOILERPLATE Updated - Type : ',old_Plate.Type),old_Plate.Type,new_Plate.Type)
end if ;
if update(BoilerPlateText) then
call AuditLog('BOILERPLATE',old_Plate.BoilerPlateID,string('BOILERPLATE Updated - BoilerPlateText : ',old_Plate.BoilerPlateText),old_Plate.BoilerPlateText,new_Plate.BoilerPlateText)
end if ;
end
}
go