====== pears.storedsearch ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Stored search headers. Individual criteria that constitute the search are stored in Criteria - with the appropiate location.
===== Columns =====
^ Column ^ Type ^ Null ^ Default ^ Comment ^
| **storedsearchid** | char(20) | NOT NULL | | |
| type | char(1) | NULL | | |
| description | char(50) | NULL | | |
| currentonly | smallint | NULL | | 0: All Except Deleted 1: Current Only 2: Include Deleted |
| permtempboth | smallint | NULL | | perm:1 temp:2 both:3 |
| departmentid | char(2) | NULL | | |
| staffid | char(20) | NULL | | |
===== Primary Key =====
* storedsearchid
===== Foreign Keys =====
^ Constraint ^ Columns ^ References ^ Delete/update action ^
| staff | staffid | [[database:tables:pears_staff|pears.staff (staffid)]] | ON DELETE CASCADE |
===== Referenced By =====
^ Table ^ Constraint ^ Columns ^ Referenced columns ^
| [[database:tables:pears_storedquicklookup|pears.StoredQuickLookup]] | StoredSearch | StoredSearchID | storedsearchid |
===== Indexes =====
* No indexes found.
===== Triggers =====
* No triggers found.
===== Original SQL =====
-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."storedsearch"
-- Table comment: Stored search headers. Individual criteria that constitute the search are stored in Criteria - with the appropiate location.
-- Statement count: 5
CREATE TABLE "pears"."storedsearch" (
"storedsearchid" char(20) NOT NULL
,"type" char(1) NULL
,"description" char(50) NULL
,"currentonly" smallint NULL
,"permtempboth" smallint NULL
,"departmentid" char(2) NULL
,"staffid" char(20) NULL
,PRIMARY KEY ("storedsearchid" ASC)
)
go
COMMENT ON COLUMN "pears"."storedsearch"."currentonly" IS
'0: All Except Deleted 1: Current Only 2: Include Deleted'
go
COMMENT ON COLUMN "pears"."storedsearch"."permtempboth" IS
'perm:1 temp:2 both:3'
go
COMMENT ON TABLE "pears"."storedsearch" IS
'Stored search headers. Individual criteria that constitute the search are stored in Criteria - with the appropiate location.'
go
ALTER TABLE "pears"."storedsearch"
ADD FOREIGN KEY "staff" ("staffid" ASC)
REFERENCES "pears"."staff" ("staffid")
ON DELETE CASCADE
go