小编 Da*_*ata的帖子

Postgresql函数返回受影响的行数

我创建了一个函数.我定义了返回值void.但我想显示受影响的行数.我能怎么做?

CREATE OR REPLACE FUNCTION update() RETURNS void  AS 
$BODY$
BEGIN
   update test_a set name='cde' where name='abc';
   update test_b set name='mno' where name='klm';
END;
$BODY$   
LANGUAGE plpgsql VOLATILE   
COST 100; 
ALTER FUNCTION update()   
OWNER TO postgres;
Run Code Online (Sandbox Code Playgroud)

postgresql

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

postgresql ×1