PostgreSQL存储过程
编写存储过程CREATE OR REPLACE FUNCTION totalRecords ()
RETURNS integer AS $total$
declare
total integer;
BEGIN
SELECT count(*) into total FROM EMPLOYEES;
RETURN total;
END;
$total$ LANGUAGE plpgsql;
执行:
select totalRecords();
文档来源:51CTO技术博客https://blog.51cto.com/u_4048786/3205926
页:
[1]