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