/**Begin D:\PDM_UPGRADE\PDM1\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTEPLAN_E' AND KSQL_COL_NAME IN ('FRELATERECORDID'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FRELATERECORDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTEPLAN_E' AND KSQL_COL_NAME IN ('FORIGINALRECORDID'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FORIGINALRECORDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTEPLAN_E' AND KSQL_COL_NAME IN ('FACCURATEMATCH'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FACCURATEMATCH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTEPLAN_E' AND KSQL_COL_NAME IN ('FMATCHEDDIMENSIONS'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FMATCHEDDIMENSIONS VARCHAR(1024) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTEPLAN_E' AND KSQL_COL_NAME IN ('FMATCHDETAILFIELDS'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FMATCHDETAILFIELDS VARCHAR(1024) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_ACLDEDUCTION' AND KSQL_COL_NAME IN ('FRELEASEACLTIME'))
ALTER TABLE T_FPM_ACLDEDUCTION ADD (FRELEASEACLTIME VARCHAR(1024) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_ACLDEDUCTION' AND KSQL_COL_NAME IN ('FRELEASEACLTIMECODE'))
ALTER TABLE T_FPM_ACLDEDUCTION ADD (FRELEASEACLTIMECODE VARCHAR(1024) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_ACLDEDUCTION' AND KSQL_COL_NAME IN ('FFACTBACKAMOUNTFIELD'))
ALTER TABLE T_FPM_ACLDEDUCTION ADD (FFACTBACKAMOUNTFIELD VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_CONTROLWAYCONFIG' AND KSQL_COL_NAME IN ('FCONTROLWARNNODE'))
ALTER TABLE T_FPM_CONTROLWAYCONFIG ADD (FCONTROLWARNNODE VARCHAR(50) DEFAULT '  ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTETIME' AND KSQL_COL_NAME IN ('FAUTORELEASE'))
ALTER TABLE T_FPM_EXECUTETIME ADD (FAUTORELEASE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTETIME' AND KSQL_COL_NAME IN ('FTIMELIMIT'))
ALTER TABLE T_FPM_EXECUTETIME ADD (FTIMELIMIT INT DEFAULT 0 NOT NULL );
EXEC p_AlterColumn 'T_FPM_MATCHRULE', 'FNUMBER', 'VARCHAR(50)', 'NOT NULL', '1111', ''' ''';


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