/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FMFORMULA')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FMFORMULA NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FVRANGETXT')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FVRANGETXT NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FMRANGETXT')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FMRANGETXT NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FVFIXDIMTXT')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FVFIXDIMTXT NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FMFIXDIMTXT')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FMFIXDIMTXT NCLOB );
 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FDEBIT', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FCREDIT', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FDIFFER', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FSUMMONEY', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FCVTBEFOREDEBIT', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FCVTBEFORECREDIT', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FCVTBEFORESUMMONEY', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FRATE', 'DECIMAL(38,20)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_BCM_RPTADJUST', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ADJUSTBALANCE') 
 CREATE TABLE T_BCM_ADJUSTBALANCE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBALANCE DECIMAL(38,20) DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\BCM_table.sql **/
