Table of Contents



pears.Country

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

Description

List of Countries used to speed address entry

Columns

Column Type Null Default Comment
CountryID char(20) NOT NULL
Name char(30) NOT NULL
AgencyID char(20) NULL
SortOrder smallint NULL

Primary Key

Foreign Keys

Constraint Columns References Delete/update action
AgencyDetails AgencyID pears.agencydetails (agencyid) ON DELETE CASCADE

Referenced By

Indexes

Triggers

Name Timing Event
WPK_country_COUNTRY after insert,delete,update order 1

Original SQL

-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."Country"
-- Table comment: List of Countries used to speed address entry
-- Statement count: 5
 
CREATE TABLE "pears"."Country" (
    "CountryID"                      CHAR(20) NOT NULL
   ,"Name"                           CHAR(30) NOT NULL
   ,"AgencyID"                       CHAR(20) NULL
   ,"SortOrder"                      SMALLINT NULL
   ,PRIMARY KEY ("CountryID" ASC) 
)
GO
 
 
COMMENT ON TABLE "pears"."Country" IS 
	'List of Countries used to speed address entry'
GO
 
 
ALTER TABLE "pears"."Country"
    ADD FOREIGN KEY "AgencyDetails" ("AgencyID" ASC)
    REFERENCES "pears"."agencydetails" ("agencyid")
    ON DELETE CASCADE
GO
 
 
CREATE TRIGGER "WPK_country_COUNTRY" after INSERT,DELETE,UPDATE ORDER 1 ON
"pears"."country"
FOR each statement
BEGIN
  CALL "WPKTrackChange"('P','COUNTRY')
END
GO
 
 
COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."Country"."WPK_country_COUNTRY" IS 
{CREATE TRIGGER WPK_country_COUNTRY 
 after INSERT,DELETE,UPDATE ORDER 1 ON
country
FOR each statement
BEGIN
  CALL WPKTrackChange('P','COUNTRY')
END
}
GO