/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FEXCEPTION') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FEXCEPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FEXCEPTION_TAG') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FEXCEPTION_TAG NCLOB );
 /**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FEXCEPTION') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FEXCEPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FEXCEPTION_TAG') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FEXCEPTION_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='fsrcdemandqty') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (fsrcdemandqty DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='fismerge') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (fismerge NVARCHAR(30) DEFAULT ' ' NOT NULL ); 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='fmergebillno') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (fmergebillno NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='fmergebillid') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (fmergebillid NVARCHAR(50) DEFAULT ' ' NOT NULL );   
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='fmergebillentryid') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (fmergebillentryid NVARCHAR(50) DEFAULT ' ' NOT NULL ); 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='fmergebillentryseq') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (fmergebillentryseq BIGINT DEFAULT 0 NOT NULL );  
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
