MT.Checks/DB/chk/functions/chk_status_select.sql

18 lines
542 B
PL/PgSQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- chk.chk_status_select: выборка всех строк справочника статусов проверок.
-- На основе: новая.
-- Параметры: нет.
-- Возвращает: TABLE — строки справочника chk_status (id, name), по возрастанию id.
CREATE OR REPLACE FUNCTION chk.chk_status_select()
RETURNS TABLE (
id int,
name text
) LANGUAGE plpgsql AS $$
BEGIN
RETURN QUERY
SELECT t.id,
t.name
FROM chk.chk_status t
ORDER BY t.id;
END;
$$;