IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYLOANBILL' AND KSQL_COL_NAME ='FISMULTIREIMBURSER')
ALTER TABLE T_ER_DAILYLOANBILL ADD (FISMULTIREIMBURSER CHAR(1) DEFAULT '0'  NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYLOANDETAIL' AND KSQL_COL_NAME ='FREIMBURSER')
ALTER TABLE T_ER_DAILYLOANDETAIL ADD (FREIMBURSER BIGINT DEFAULT 0 NOT NULL );

UPDATE T_ER_DAILYLOANBILL SET  FISMULTIREIMBURSER = '0';
UPDATE T_ER_DAILYLOANDETAIL DETAIL
SET FREIMBURSER = (SELECT FAPPLIERID FROM T_ER_DAILYLOANBILL BILL WHERE BILL.FID =  DETAIL.FID)
WHERE  EXISTS(SELECT  1 FROM T_ER_DAILYLOANBILL  BILL WHERE BILL.FID = DETAIL.FID );


