%ROWTYPE声明变量
CREATE OR REPLACE PROCEDURE testatlasdb()
is
v_ss at_tb2%ROWTYPE;
BEGIN
select * into v_ss from at_tb2 limit 1;
raise notice '%', v_ss.id;
raise notice '%',v_ss.name;
END;
/
vastbase=# select * from at_tb2;
id | name
----+-----------
1 | before s1
2 | after s1
(2 rows)
vastbase=# call testatlasdb();
NOTICE: 1
NOTICE: before s1
testatlasdb
-------------
(1 row)