postgres 存储过程 select 结果 变量赋值

 写Postgres存储过程时,不晓得怎么讲select查出的值赋值给变量,今天知道了用select INTO 

create or replace function "public"."getdescription"() returns varchar as

$body$
DECLARE

        temp varchar; 

BEGIN

        select code into temp from cfvariable where id=223;

        raise notice 'code %', temp; 

        return temp;

end
$body$
LANGUAGE 'plpgsql' volatile called on null input security invoker;
原文地址:https://www.cnblogs.com/kevinge/p/2514820.html