do LANGUAGE plpgsql $$ declare top integer; row_org dbo.a_org_type%rowtype; begin /* Insert real code here */ select into row_org * from dbo.a_org_type order by id desc limit 1; top := row_org.id + 1; for idx in 1..5 loop insert into dbo.a_org_type(id, des) values(top, 'shang hai ' || top); top := top + 1; end loop; end; $$