/**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_TRANSDIRBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_TRANSDIRBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_PRODUCTINBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_MREQOUTBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_TRANSOUTBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_ADJUSTBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_ASSEMBBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_LOCATIONTRANSFER' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_LOCATIONTRANSFER ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_OTHEROUTBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_OTHERINBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FASYNCSTATUS') 
 ALTER TABLE T_IM_PURRECBILL ADD (FASYNCSTATUS CHAR(1) DEFAULT 'B' NOT NULL );

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