/**Begin D:\softwaresetup\PDM_UPGRADE\PDM1\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_REPORTDATAMAIN' AND KSQL_COL_NAME IN ('FREPORTPLANAMT')) 
 ALTER TABLE T_FPM_REPORTDATAMAIN ADD (FREPORTPLANAMT 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 ('FSOURCEID')) 
 ALTER TABLE T_FPM_REPORTDATAMAIN ADD (FSOURCEID VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_REPORTDATAMAIN' AND KSQL_COL_NAME IN ('FSOURCEID_TAG')) 
 ALTER TABLE T_FPM_REPORTDATAMAIN ADD (FSOURCEID_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FPM_REPORT' AND KSQL_COL_NAME IN ('FREPORTPLANTYPE')) 
 ALTER TABLE T_FPM_REPORT ADD (FREPORTPLANTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_REPORT_SUMRECORD') 
 CREATE TABLE T_FPM_REPORT_SUMRECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSUMORGREPORTID BIGINT DEFAULT 0 NOT NULL,
FSUMSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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