VastbaseE100

基于开源技术的HTAP数据库管理系统。性能优异,稳定可靠,提供诸多专属领域特性。

Menu

%ROWTYPE声明变量

CREATE OR REPLACE PROCEDURE testatlasdb() AS $$  
DECLARE  
  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;  
$$ LANGUAGE plpgsql;  
atlasdb=# select * from at_tb2;
 id |   name    
----+-----------
  1 | before s1
  2 | after s1
(2 rows)

atlasdb=# call testatlasdb();
NOTICE:  1
NOTICE:  before s1
CALL