行类型

简介

要访问行变量的字段,可以使用 .

行变量.字段名

示例

我们将使用示例数据中的 actor 表来作演示。

以下示例显示了 id 为 10的演员的信息:

do $$
declare
   selected_actor actor%rowtype;
begin
   -- 选择ID为10的演员   
   select * 
   from actor
   into selected_actor
   where actor_id = 10;

   -- 显示演员信息
   raise notice '演员的名字是:% %',
      selected_actor.first_name,
      selected_actor.last_name;
end $$;
要查看完整内容,请先登录