×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
/* *_> CNLLSTSPLF SRCFILE(@2/@1) SRCMBR(@3)
*/
/* *_> DLTF FILE(@5/@4)
*/
/* *_> RUNSQLSTM SRCFILE(@2/@1) SRCMBR(@3) +
*/
/* *_> DFTRDBCOL(@5) CLOSQLCSR(*ENDMOD) ERRLVL(20)
*/
/*
*----------------------------------------------------------------------*/
/* * SQL File...: CUSTMASTER Project.....:
*/
/* * Long Name..: CUSTOMER_MASTER
*/
/* * Legacy Name: CUSTMAST
*/
/* * Author.....: A. Campin Date written: 04/23/2009
*/
/* * Purpose....: Define Customers.
*/
/*
*----------------------------------------------------------------------*/
CREATE TABLE CUSTMASTER (
ID FOR COLUMN CUID BIGINT
GENERATED ALWAYS AS IDENTITY (
START WITH 1 INCREMENT BY 1
NO MINVALUE NO MAXVALUE
NO CYCLE NO ORDER
CACHE 20 ),
CODE FOR COLUMN CUCODE CHAR(6) CCSID 37 NOT
NULL DEFAULT '',
DELETE_CODE FOR COLUMN CUDLT CHAR(1) CCSID 37 NOT
NULL DEFAULT '',
NAME FOR COLUMN CUNAME CHAR(25) CCSID 37 NOT
NULL DEFAULT '',
ADDRESS_ONE FOR COLUMN CUBAD1 CHAR(25) CCSID 37 NOT
NULL DEFAULT '',
ADDRESS_TWO FOR COLUMN CUBAD2 CHAR(25) CCSID 37 NOT NULL
DEFAULT '',
CITY FOR COLUMN CUBCTY CHAR(15) CCSID 37 NOT NULL
DEFAULT '',
STATE FOR COLUMN CUBST CHAR(2) CCSID 37 NOT NULL
DEFAULT '',
ZIP FOR COLUMN CUBZIP CHAR(5) CCSID 37 NOT NULL
DEFAULT '',
ZIP_EXTENSION FOR COLUMN CUBZP2 CHAR(4) CCSID 37 NOT NULL
DEFAULT '',
CITY_ID FOR COLUMN CUBCTC INTEGER,
BILL_TO_ID FOR COLUMN CUBLCD BIGINT,
ADDED_TIMESTAMP FOR COLUMN CUADDTS TIMESTAMP DEFAULT
CURRENT TIMESTAMP,
ADDED_USER FOR COLUMN CUADDUSER CHAR(18) CCSID 37 NOT
NULL DEFAULT USER,
UPDATED_TIMESTAMP FOR COLUMN CUUPDTS TIMESTAMP DEFAULT
CURRENT TIMESTAMP,
UPDATED_USER FOR COLUMN CUUPDUSER CHAR(18) CCSID 37 NOT
NULL DEFAULT USER,
PRIMARY KEY(ID))
RCDFMT RCUSTMAST;
RENAME CUSTMASTER TO CUSTOMER_MASTER;
RENAME CUSTOMER_MASTER TO SYSTEM NAME CUSTMASTER;
ALTER TABLE CUSTOMER_MASTER
ADD CONSTRAINT FOR_CUSTMASTER_CUBCTC_00001
FOREIGN KEY(CITY_ID)
REFERENCES CITIES_MASTER (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION ;
ALTER TABLE CUSTOMER_MASTER
ADD CONSTRAINT FOR_CUSTMASTER_CUBLCD_00001
FOREIGN KEY(BILL_TO_ID)
REFERENCES CUSTOMER_MASTER (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION ;
LABEL ON TABLE CUSTOMER_MASTER
IS 'Customer Master file.' ;
LABEL ON COLUMN CUSTOMER_MASTER (
ID IS 'Customer Id',
CODE IS 'Cust Code' ,
DELETE_CODE IS 'Dlt Code' ,
NAME IS 'Name' ,
ADDRESS_ONE IS 'Address One',
ADDRESS_TWO IS 'Address Two',
CITY IS 'City' ,
STATE IS 'State' ,
ZIP IS 'Zip Code' ,
ZIP_EXTENSION IS 'Zip Ext' ,
CITY_ID IS 'City Id' ,
BILL_TO_ID IS 'Bill To Id' ,
ADDED_TIMESTAMP IS 'Added Timestamp',
ADDED_USER IS 'Added User',
UPDATED_TIMESTAMP IS 'Updated Timestamp',
UPDATED_USER IS 'Updated User');
LABEL ON COLUMN CUSTOMER_MASTER (
ID TEXT IS 'Customer Id',
CODE TEXT IS 'Cust Code' ,
DELETE_CODE TEXT IS 'Delete Code' ,
NAME TEXT IS 'Name' ,
ADDRESS_ONE TEXT IS 'Address One',
ADDRESS_TWO TEXT IS 'Address Two',
CITY TEXT IS 'City' ,
STATE TEXT IS 'State' ,
ZIP TEXT IS 'Zip Code' ,
ZIP_EXTENSION TEXT IS 'Zip Ext' ,
CITY_ID TEXT IS 'City Id',
BILL_TO_ID TEXT IS 'Bill To Id' ,
ADDED_TIMESTAMP TEXT IS 'Added Timestamp',
ADDED_USER TEXT IS 'Added User',
UPDATED_TIMESTAMP TEXT IS 'Updated Timestamp',
UPDATED_USER TEXT IS 'Updated User');
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.