CREATE OR REPLACE FUNCTION autoGenFeature_function() RETURNS text AS $$DECLAREb_count int;beacon_id int;_total int; BEGINselect count(*) into b_count from beacon;_total := b_count;while b_count>0 loopselect pid into beacon_id from beacon limit 1 offset b_count-1;insert into workfeature(typeid, typeactid, beaconid, creatorid, createdate, remark) values (7, 7, beacon_id, 1, now(), '系统自动生成的航标巡检作业');b_count := b_count-1;end loop; RETURN '一共添加了' || _total || '个航标的巡检作业'; END;$$ LANGUAGE plpgsql;CREATE OR REPLACE FUNCTION autoGenFeature_func 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交