IF EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_ELECSTATEMENT_B' AND KSQL_COL_NAME IN ('FISBALANCESTATE'))
    update t_bei_elecstatement set fbilltype = 'bei_elecstatement' where fid in (select fid from t_bei_elecstatement_b where fisbalancestate = '0');
IF EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_ELECSTATEMENT_B' AND KSQL_COL_NAME IN ('FISBALANCESTATE'))
    update t_bei_elecstatement set fbilltype = 'bei_elecbalancestate' where fid in (select fid from t_bei_elecstatement_b where fisbalancestate = '1');

update t_bei_elecstatement set fdatasource = 'frombank' where fdatasource = 'bei';