当前位置: 移动技术网 > IT编程>数据库>其他数据库 > postgresql sql批量更新记录

postgresql sql批量更新记录

2017年12月08日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下:create function updatetchrnm() returns void as $body$ declare rownum integer
复制代码 代码如下:

create function updatetchrnm() returns void as
$body$
declare
rownum integer := 1;
begin
while rownum <= 1000 loop
    update t_tchr set tchr_nm = '田中愛子' || rownum, tchr_knm = 'タナカアイコ' || rownum, tchr_anm = 'tanaka' || rownum where tchr_cd = 'tchr' || (1000000 + rownum);
    rownum := rownum + 1;
end loop;
return;
end;

$body$ language 'plpgsql';
select updatetchrnm();

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网