/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FREMAINQTY') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FREMAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FEPDDATE') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FEPDDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FRPDDATE') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FRPDDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FSALEORG') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FSALEORG BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FOUTSTOCKQTY') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FOUTSTOCKQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FORDERREMAINQTY') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FORDERREMAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FBILLTYPE') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FBILLTYPE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FSENDGOODSDATE') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FSENDGOODSDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_ORDERSETOFF' AND KSQL_COL_NAME ='FORDERSTATUS') 
 ALTER TABLE T_MDS_ORDERSETOFF ADD (FORDERSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL );

/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
