IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MDS_FCDATATSENTRY ADD (FPLANSCOPE  BIGINT DEFAULT 0 NOT NULL  );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATADTLENT' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MDS_FCDATADTLENT ADD (FPLANSCOPE  BIGINT DEFAULT 0 NOT NULL  );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATADTLENTBK' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MDS_FCDATADTLENTBK ADD (FPLANSCOPE  BIGINT DEFAULT 0 NOT NULL  );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_RECEIVEDATA' AND KSQL_COL_NAME ='FPLANSCOPE') 
 ALTER TABLE T_MDS_RECEIVEDATA ADD (FPLANSCOPE  BIGINT DEFAULT 0 NOT NULL  );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_RECEIVEDATA' AND KSQL_COL_NAME ='FBASEUNITID') 
 ALTER TABLE T_MDS_RECEIVEDATA ADD (FBASEUNITID  BIGINT DEFAULT 0 NOT NULL  );

  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_FCDATATSENTRY_KZ' AND KSQL_COL_NAME ='FPLANSCOPE')
  ALTER TABLE T_MDS_FCDATATSENTRY_KZ ADD (FPLANSCOPE  BIGINT DEFAULT 0 NOT NULL  );

  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAFETYSTOCK' AND KSQL_COL_NAME ='FPLANSCOPE')
  ALTER TABLE T_MDS_SAFETYSTOCK ADD (FPLANSCOPE  BIGINT DEFAULT 0 NOT NULL  );