基本类型
最近更新时间: 2025-02-18 16:02:00
postgres=# CREATE OR REPLACE PROCEDURE p_base_para (a_int integer,a_str text) AS
$$
BEGIN
RAISE NOTICE 'a_int = % ; a_str = %',a_int,a_str;
END;
$$
LANGUAGE PLPGSQL;
CREATE PROCEDURE
postgres=# CALL p_base_para(1,'Tbase');
NOTICE: a_int = 1 ; a_str = Tbase
CALL
postgres=#
postgres=# CREATE OR REPLACE PROCEDURE p_base_array (a_int integer[],a_str text[]) AS
$$
BEGIN
RAISE NOTICE 'a_int = % ; a_str = %',a_int,a_str;
END;
$$
LANGUAGE PLPGSQL;
CREATE PROCEDURE
postgres=# CALL p_base_array(ARRAY[1,2,3],ARRAY['TBase','pgxz']);
NOTICE: a_int = {1,2,3} ; a_str = {TBase,pgxz}
CALL
postgres=#