函数学习

create or replace function FN_SET_CHANGEID
return number
is
/**
* 改变CHANGEID
**/
  sqlStr varchar2(200);
begin
         sqlStr := 'select sysdate form dual';
         dbms_output.put_line(sqlStr);
    for obj in (select * from t_c_tradeauth) loop
      update t_c_tradeauth t set changeid = test.nextval where t.firmid =obj.firmid;
      end loop;
    return 1;
exception
    when others then
        rollback;
        return -100;
end;

猜你喜欢

转载自love398146779.iteye.com/blog/1893391