pgsql存储函数简单使用-返回影响行数

CREATE OR REPLACE FUNCTION "public"."generate_road_list_id_to_jcpddas"("road_code_param" varchar)

  RETURNS "pg_catalog"."int4" AS $BODY$
declare returnvalue integer;
BEGIN
  UPDATE road_jcpd_record rjr set road_lst_id = rl.id from road_lst rl where rl.road_code = rjr.road_code and rl.road_code = road_code_param ;
  GET DIAGNOSTICS returnvalue = ROW_COUNT;
  return returnvalue;
END$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100

posted @ 2022-08-18 18:49  懂得归零  阅读(110)  评论(0编辑  收藏  举报