CREATE FUNCTION count_test(val INTEGER) RETURNS INTEGER AS
DECLARE
rtest RECORD;
cnt INTEGER;
BEGIN
cnt := 0;
FOR rtest IN SELECT * FROM test WHERE some_column > val LOOP
cnt := cnt + 1;
( ________ );
RETURN cnt;
END;
LANGUAGE plpgsql;
© EDUCO All Rights Reserved.