pgsql游标批量插入数据,id基于最大值自增
CREATE OR REPLACE FUNCTION bach_save_config(c_code text,c_name text,c_type text,c_value text,c_business_type_name text,c_memo text)
RETURNS refcursor AS
$BODY$
declare
c_org_id int8;
orgid_list refcursor;
c_id_plus int8 DEFAULT 1 ;
isexist int8;
BEGIN
OPEN orgid_list for EXECUTE 'select his_org_id from "comm"."hospital" group by his_org_id';
loop
fetch orgid_list into c_org_id;
if found then
共有 0 条评论