/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME IN ('FPRICES')) 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FPRICES DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY' AND KSQL_COL_NAME IN ('FAMOUNTS')) 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY ADD (FAMOUNTS DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='freturnbaseqtys') 
 ALTER TABLE t_im_productinbillentry_R ADD (freturnbaseqtys DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='fremainreturnbaseqtys') 
 ALTER TABLE t_im_productinbillentry_R ADD (fremainreturnbaseqtys DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='freturnqtys') 
 ALTER TABLE t_im_productinbillentry_R ADD (freturnqtys DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_productinbillentry_R' AND KSQL_COL_NAME ='fremainreturnqtys') 
 ALTER TABLE t_im_productinbillentry_R ADD (fremainreturnqtys DECIMAL(23,10) DEFAULT 0 NOT NULL );

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PRODUCTINBILLENTRY', 'FPRICE', 'NULL', 'NULL', '1001', 'NULL';
 
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_IM_PRODUCTINBILLENTRY', 'FAMOUNT', 'NULL', 'NULL', '1001', 'NULL';

  --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 't_im_productinbillentry_R', 'freturnbaseqty', 'NULL', 'NULL', '1001', 'NULL';
 
  --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 't_im_productinbillentry_R', 'fremainreturnbaseqty', 'NULL', 'NULL', '1001', 'NULL';
 
  --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 't_im_productinbillentry_R', 'freturnqty', 'NULL', 'NULL', '1001', 'NULL';
 
  --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 't_im_productinbillentry_R', 'fremainreturnqty', 'NULL', 'NULL', '1001', 'NULL';
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/

