/**Begin D:\PDM_UPGRADE\PDM1\BEI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEDETAILCOUNT'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEDETAILCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEDETAILMATCHCOUNT'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEDETAILMATCHCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEELECCOUNT'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEELECCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEELECMATCHCOUNT'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEELECMATCHCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEDETAILDEBITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEDETAILDEBITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEDETAILCREDITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEDETAILCREDITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEELECDEBITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEELECDEBITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEELECCREDITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEELECCREDITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FEDEBITBALANCE'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FEDEBITBALANCE DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORDLOG' AND KSQL_COL_NAME IN ('FECREDITBALANCE'))
 ALTER TABLE T_BEI_MISSRECORDLOG ADD (FECREDITBALANCE DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FDETAILCOUNT'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FDETAILCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FDETAILMATCHCOUNT'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FDETAILMATCHCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FELECCOUNT'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FELECCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FELECMATCHCOUNT'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FELECMATCHCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FDETAILDEBITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FDETAILDEBITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FDETAILCREDITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FDETAILCREDITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FELECDEBITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FELECDEBITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FELECCREDITTOTAL'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FELECCREDITTOTAL DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FDEBITBALANCE'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FDEBITBALANCE DECIMAL(23,10) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_MISSRECORD' AND KSQL_COL_NAME IN ('FCREDITBALANCE'))
 ALTER TABLE T_BEI_MISSRECORD ADD (FCREDITBALANCE DECIMAL(23,10) );

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