定义变量无需要declare

最近更新时间: 2024-10-17 17:10:00

  • declare用法。
postgres=# create or replace procedure p_declare() is
declare
    v_int int;
begin
    v_int:=1;
    raise notice 'v_int = %',v_int;
end ;
/
CREATE PROCEDURE
  • 无declare用法。
postgres=# create or replace procedure p_declare() is
    v_int int;
begin
    v_int:=1;
    raise notice 'v_int = %',v_int;
end ;
/
CREATE PROCEDURE
postgres=# call p_declare();
NOTICE:  v_int = 1
CALL
postgres=#