tldm-universe/Ardent/UV/src.u/catalog.u

69 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
/******************************************************************************
/*
/* catalog.u - This is the information which needs to be put into
/* the VOC file in the SQL catalog.
/*
/* Module %M% Version %I% Date %H%
/*
/* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
/* This is unpublished proprietary source code of Ardent Software Inc.
/* The copyright notice above does not evidence any actual or intended
/* publication of such source code.
/*
/******************************************************************************
/*
/* Maintenence log - insert most recent change descriptions at top
/*
/* Date.... GTAR# WHO Description.........................................
/* 11/04/98 23807 JBG Add UPDATE.UV_COLUMNS and UPDATE.UV_ASSOC.
/* 10/14/98 23801 SAP Change copyrights.
/* 03/31/92 9371 DPB Added SQL catalog installation.
/*
/******************************************************************************
UV_TABLES F
UV_TABLES
D_UV_TABLES
UV_COLUMNS F
UV_COLUMNS
D_UV_COLUMNS
UV_USERS F
UV_USERS
D_UV_USERS
UV_ASSOC F
UV_ASSOC
D_UV_ASSOC
UV_SCHEMA F
UV_SCHEMA
D_UV_SCHEMA
UV_VIEWS F
UV_VIEWS
D_UV_VIEWS
&SAVEDLISTS& F
&SAVEDLISTS&
D_&SAVEDLISTS&
VOCLIB F
VOCLIB
D_VOCLIB
UPDATE.UV_ASSOC PAragraph to update ORDERING CHECK constraint
DISPLAY Must run as uvsql or root with SQL DBA authority.
DISPLAY First remove old unnamed constraint.
ALTER TABLE UV_ASSOC DROP CONSTRAINT "UNNAMED*1";
DISPLAY Now add correct constraint.
ALTER TABLE UV_ASSOC ADD CONSTRAINT "CHECKORDER" CHECK (ORDERING = 'UNORDERED' OR ORDERING = 'FIRST' OR ORDERING = 'LAST' OR ORDERING = 'PRESERVING' OR ORDERING = 'IN_COL_BY');
DISPLAY Now give names to other constraints.
ALTER TABLE UV_ASSOC DROP CONSTRAINT "UNNAMED*1";
ALTER TABLE UV_ASSOC ADD CONSTRAINT "CHECKTYPE" CHECK (ORDER_TYPE = 'AL' OR ORDER_TYPE = 'AR' OR ORDER_TYPE = 'DL' OR ORDER_TYPE = 'DR' OR ORDER_TYPE = '');
ALTER TABLE UV_ASSOC DROP CONSTRAINT "UNNAMED*1";
ALTER TABLE UV_ASSOC ADD CONSTRAINT "CHECKEMPTY" CHECK (EMPTY_ROW = 'YES' OR EMPTY_ROW = 'NO');
UPDATE.UV_COLUMNS PAragraph to update DATA_TYPE CHECK constraint
DISPLAY Must run as uvsql or root with SQL DBA authority.
DISPLAY First remove old unnamed constraint.
ALTER TABLE UV_COLUMNS DROP CONSTRAINT "UNNAMED*3";
DISPLAY Now add correct constraint.
ALTER TABLE UV_COLUMNS ADD CONSTRAINT "CHECKDT" CHECK (DATA_TYPE = 'INT' OR DATA_TYPE = 'SMALLINT' OR DATA_TYPE = 'CHAR' OR DATA_TYPE = 'FLOAT' OR DATA_TYPE = 'REAL' OR DATA_TYPE = 'DOUBLE' OR DATA_TYPE = 'VARCHAR' OR DATA_TYPE = 'DECIMAL' OR DATA_TYPE = 'NUMERIC' OR DATA_TYPE = 'DATE' OR DATA_TYPE = 'TIME');
DISPLAY Now give names to other constraints.
ALTER TABLE UV_COLUMNS DROP CONSTRAINT "UNNAMED*2";
ALTER TABLE UV_COLUMNS ADD CONSTRAINT "CHECKNULL" CHECK (NULLABLE = 'YES' OR NULLABLE = 'NO');
ALTER TABLE UV_COLUMNS DROP CONSTRAINT "UNNAMED*1";
ALTER TABLE UV_COLUMNS ADD CONSTRAINT "CHECKMV" CHECK (MULTI_VALUE = 'M' OR MULTI_VALUE = 'S');