寫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;