--计划方案建议增加多组织供需关系和存储位置字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPROGRAM' AND KSQL_COL_NAME ='FMULID') 
 ALTER TABLE T_MRP_PLANPROGRAM ADD (FMULID BIGINT DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPROGRAM' AND KSQL_COL_NAME ='FORGRANGID') 
ALTER TABLE T_MRP_PLANPROGRAM ADD (FORGRANGID NVARCHAR(255) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPROGRAM' AND KSQL_COL_NAME ='FORGRANGID_TAG') 
ALTER TABLE T_MRP_PLANPROGRAM ADD (FORGRANGID_TAG NCLOB );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPROGRAM' AND KSQL_COL_NAME ='FISNEW') 
ALTER TABLE T_MRP_PLANPROGRAM ADD (FISNEW CHAR(1) DEFAULT '0' NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPROGRAM' AND KSQL_COL_NAME ='FSELORGRANGID') 
ALTER TABLE T_MRP_PLANPROGRAM ADD (FSELORGRANGID NVARCHAR(255) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPROGRAM' AND KSQL_COL_NAME ='FSELORGRANGID_TAG') 
ALTER TABLE T_MRP_PLANPROGRAM ADD (FSELORGRANGID_TAG NCLOB );

