首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >游标postgresql中的ROWTYPE

游标postgresql中的ROWTYPE
EN

Stack Overflow用户
提问于 2016-10-04 22:58:24
回答 1查看 1.5K关注 0票数 0

我想知道在postgresql (pl/pgsql)中是否可以为游标获取"Rowtype“。。。

我的游标有一个select from多个表,但我不知道如何获取行类型。

代码语言:javascript
复制
c_Data CURSOR FOR 
select 
 dst_description 
, cnt_number 
, prd_name 
, grt_code 
, res_currency 
, res_date 
, prm_installmentdate 

from tbl_xxx, tbl_yyy, tbl_aaa
where cnt_id = res_xxx
and prd_id = cnt_yyy
and dst_id = prd_aaa
and grt_id = res_xxx
and prm_id = res_aaa; 

l_Data c_Data%rowtype;

请帮帮忙

EN

回答 1

Stack Overflow用户

发布于 2016-10-05 21:02:01

更像是这条路。

代码语言:javascript
复制
declare 
l_data record; 

begin
select 
INTO l_data --<<
 dst_description 
, cnt_number 
, prd_name 
, grt_code 
, res_currency 
, res_date 
, prm_installmentdate 
from tbl_xxx, tbl_yyy, tbl_aaa
where cnt_id = res_xxx
and prd_id = cnt_yyy
and dst_id = prd_aaa
and grt_id = res_xxx
and prm_id = res_aaa; 

然后,l_data将是您需要的行类型。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39855624

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档