/**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 ('FDBROUTEKEY'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FDBROUTEKEY VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_EXECUTEPLAN_E' AND KSQL_COL_NAME IN ('FCONTROLTRACEID'))
ALTER TABLE T_FPM_EXECUTEPLAN_E ADD (FCONTROLTRACEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_REPORTDATAMAIN' AND KSQL_COL_NAME IN ('FHOLDLOCKAMT'))
ALTER TABLE T_FPM_REPORTDATAMAIN ADD (FHOLDLOCKAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_REPORTDATAMAIN' AND KSQL_COL_NAME IN ('FHOLDREALAMT'))
ALTER TABLE T_FPM_REPORTDATAMAIN ADD (FHOLDREALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_CONTROLHOLDINFO')
CREATE TABLE T_FPM_CONTROLHOLDINFO (
                                       FID BIGINT DEFAULT 0 NOT NULL,
                                       FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                       FSEQ INT DEFAULT 0 NOT NULL,
                                       FREPORTDATAID BIGINT DEFAULT 0 NOT NULL,
                                       FHOLDLOCKAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
                                       FHOLDACTAMT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_WAITCONSUMERECORD')
CREATE TABLE T_FPM_WAITCONSUMERECORD (
                                         FID BIGINT DEFAULT 0 NOT NULL,
                                         FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                         FSEQ INT DEFAULT 0 NOT NULL,
                                         FRECORDID BIGINT DEFAULT 0 NOT NULL
);



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