/**Begin D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FMYECMONEY') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FMYECMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FOPECMONEY') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FOPECMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FMYCVTPATH') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FMYCVTPATH VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FOPCVTPATH') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FOPCVTPATH VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FMYRATE') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FMYRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FOPRATE') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FOPRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FMYCVTMONEY') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FMYCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FOPCVTMONEY') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FOPCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FCVTDIFMONEY') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FCVTDIFMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FMYACCOUNT') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FMYACCOUNT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORDENTRY' AND KSQL_COL_NAME ='FOPACCOUNT') 
 ALTER TABLE T_BCM_CHECKRECORDENTRY ADD (FOPACCOUNT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FMYENTITY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FMYENTITY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FOPENTITY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FOPENTITY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FMYECMONEY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FMYECMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FOPECMONEY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FOPECMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FMYCVTPATH') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FMYCVTPATH VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FOPCVTPATH') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FOPCVTPATH VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FMYRATE') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FMYRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FOPRATE') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FOPRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FMYCVTMONEY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FMYCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FOPCVTMONEY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FOPCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FCVTDIFMONEY') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FCVTDIFMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKRECORD' AND KSQL_COL_NAME ='FMARK') 
 ALTER TABLE T_BCM_CHECKRECORD ADD (FMARK NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHECKTMPL' AND KSQL_COL_NAME ='FBALANCE') 
 ALTER TABLE T_BCM_CHECKTMPL ADD (FBALANCE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_CHECKRECORDID') 
 CREATE TABLE T_BCM_CHECKRECORDID (
FID BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FCOMPANY BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FSCENE BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL,
FENTITY BIGINT DEFAULT 0 NOT NULL,
FDELETEDCHECKID BIGINT DEFAULT 0 NOT NULL,
FMYCOMPANY BIGINT DEFAULT 0 NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
