-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."WPKView"
-- Table comment: Woodpecker View definitions.
-- Statement count: 30
CREATE TABLE "pears"."WPKView" (
"WPKViewID" CHAR(50) NOT NULL INLINE 50 PREFIX 8
,"WPKFormID" CHAR(50) NOT NULL INLINE 50 PREFIX 8
,"Name" CHAR(50) NOT NULL
,"ViewType" CHAR(20) NOT NULL
,"Notes" long VARCHAR NULL
,"FromClause" long VARCHAR NULL
,"WhereClause" long VARCHAR NULL
,"UpdateTable" long VARCHAR NULL
,"UpdatePrimaryKey" long VARCHAR NULL
,"CanSelect" CHAR(100) NULL INLINE 100 PREFIX 8
,"CanEdit" CHAR(100) NULL INLINE 100 PREFIX 8
,"Image" CHAR(50) NULL
,"BackColour" CHAR(100) NULL INLINE 100 PREFIX 8
,"FontColour" CHAR(100) NULL INLINE 100 PREFIX 8
,"CaptionBackColour" CHAR(100) NULL
,"CaptionFontColour" CHAR(100) NULL INLINE 100 PREFIX 8
,"CaptionWidth" CHAR(50) NULL
,"DoubleClickButtonID" CHAR(50) NULL
,"UpdateVideoRecordType" CHAR(50) NULL
,"NeedsReloadCheck" CHAR(50) NULL
,"NeedsRebuildCheck" CHAR(50) NULL
,"Explanation" long VARCHAR NULL
,"OuterJoinIndicatorFields" long VARCHAR NULL
,"DragSourceType" CHAR(50) NULL
,"DropTargetType" CHAR(50) NULL
,"ValidationScript" long VARCHAR NULL
,"GridMultiSelect" CHAR(1) NULL
,"MultiSelectColumnTitle" CHAR(50) NULL
,"PreOpenScript" long VARCHAR NULL
,"SaveScript" long VARCHAR NULL
,PRIMARY KEY ("WPKViewID" ASC,"WPKFormID" ASC)
)
GO
COMMENT ON COLUMN "pears"."WPKView"."ViewType" IS
'Grid, Inspector, Memo, Panel, Search'
GO
COMMENT ON COLUMN "pears"."WPKView"."WhereClause" IS
'Parameter values have form G_globalswitch, F_formswitch, Q_querycolumn, C_ConnectionAttribute, V_ViewItem. {} substitution also allowed'
GO
COMMENT ON COLUMN "pears"."WPKView"."UpdateTable" IS
'Usually single table but may be a list'
GO
COMMENT ON COLUMN "pears"."WPKView"."UpdatePrimaryKey" IS
'May be multiple comma separated keys. If Multi-table then one key list per line'
GO
COMMENT ON COLUMN "pears"."WPKView"."CanSelect" IS
'Literal boolean or switch controlling availability in outlook bar. If switched off can still be used explicitly as one of the top views in a layout'
GO
COMMENT ON COLUMN "pears"."WPKView"."CanEdit" IS
'Literal boolean or switch. If blank inherits from form'
GO
COMMENT ON COLUMN "pears"."WPKView"."Image" IS
'Literal string or switch pointing to the wpkimageid to be used on the outlook bar'
GO
COMMENT ON COLUMN "pears"."WPKView"."BackColour" IS
'Literal integer or switch'
GO
COMMENT ON COLUMN "pears"."WPKView"."FontColour" IS
'Literal integer or switch'
GO
COMMENT ON COLUMN "pears"."WPKView"."CaptionBackColour" IS
'Literal integer or switch'
GO
COMMENT ON COLUMN "pears"."WPKView"."CaptionFontColour" IS
'Literal integer or switch'
GO
COMMENT ON COLUMN "pears"."WPKView"."CaptionWidth" IS
'Literal integer or switch. For Inspectors'
GO
COMMENT ON COLUMN "pears"."WPKView"."DoubleClickButtonID" IS
'Literal string or switch'
GO
COMMENT ON COLUMN "pears"."WPKView"."UpdateVideoRecordType" IS
'View is updated in response to changes in expanded forms of this VideoRecordType'
GO
COMMENT ON COLUMN "pears"."WPKView"."NeedsReloadCheck" IS
'Used by wizard to determine if a view needs to be reloaded'
GO
COMMENT ON COLUMN "pears"."WPKView"."NeedsRebuildCheck" IS
'Used by wizard and on normal refresh to determine if a view needs to be rebuilt'
GO
COMMENT ON COLUMN "pears"."WPKView"."Explanation" IS
'Explanation panel at top of view. For wizards'
GO
COMMENT ON COLUMN "pears"."WPKView"."OuterJoinIndicatorFields" IS
'List of fields which if one of them contains a value indicates that a row should be inserted if not present, or if none then deleted if present'
GO
COMMENT ON COLUMN "pears"."WPKView"."DragSourceType" IS
'Used by the drag mechanism to switch on dragging and identify the type of source record. Uses UpdatePrimaryKey to locate the key'
GO
COMMENT ON COLUMN "pears"."WPKView"."DropTargetType" IS
'Used by the drag mechanism to handle dropping requests'
GO
COMMENT ON COLUMN "pears"."WPKView"."ValidationScript" IS
'Allows for more complex validation. If script aborts without finishing validation has failed'
GO
COMMENT ON COLUMN "pears"."WPKView"."GridMultiSelect" IS
'M=By Mouse, C=By Checkbox, S=By Checkbox and trigger database save, Blank=None'
GO
COMMENT ON COLUMN "pears"."WPKView"."MultiSelectColumnTitle" IS
'The column title of the multi-select checkbox'
GO
COMMENT ON COLUMN "pears"."WPKView"."PreOpenScript" IS
'Executed before opening for e.g. populating a temporary table'
GO
COMMENT ON COLUMN "pears"."WPKView"."SaveScript" IS
'Executed after the normal save, if there are changes, or if any rows are selected'
GO
COMMENT ON TABLE "pears"."WPKView" IS
'Woodpecker View definitions.'
GO
ALTER TABLE "pears"."WPKView"
ADD NOT NULL FOREIGN KEY "WPKForm" ("WPKFormID" ASC)
REFERENCES "pears"."WPKForm" ("WPKFormID")
ON DELETE CASCADE
GO
CREATE TRIGGER "WPKTrackViewChange" after INSERT,DELETE,UPDATE ORDER 1 ON
"pears"."WPKView"
REFERENCING NEW AS "vw"
FOR each ROW
BEGIN
CALL "WPKTrackChange"('F',"vw"."WPKFormID")
END
GO
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."WPKView"."WPKTrackViewChange" IS
{CREATE TRIGGER WPKTrackViewChange
after INSERT,DELETE,UPDATE ORDER 1 ON
WPKView
REFERENCING NEW AS vw
FOR each ROW
BEGIN
CALL WPKTrackChange('F',vw.WPKFormID)
END
}
GO