
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATA' AND KSQL_COL_NAME ='FSUPORG') 
 ALTER TABLE T_MDS_FCDATA ADD (FSUPORG BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SALORDPLAN' AND KSQL_COL_NAME ='FINVQTY') 
 ALTER TABLE T_MDS_SALORDPLAN ADD (FINVQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SALORDPLAN' AND KSQL_COL_NAME ='FINVQTYSTATUS') 
 ALTER TABLE T_MDS_SALORDPLAN ADD (FINVQTYSTATUS NVARCHAR(30) DEFAULT 'A' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SALORDPLAN' AND KSQL_COL_NAME ='FWRITEOFFNUM') 
 ALTER TABLE T_MDS_SALORDPLAN ADD (FWRITEOFFNUM DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATADTLENT' AND KSQL_COL_NAME ='FWRITEOFFNUM') 
 ALTER TABLE T_MDS_FCDATADTLENT ADD (FWRITEOFFNUM DECIMAL(23,10) DEFAULT 0 NOT NULL);
 

