Mybatis调用函数,返回联合数组的配置文件如何配置?

zack_kane zack_kane 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
定义了一个type,然后定义了一个table联合数组,函数的返回值为数组:代码如下:
--创建type对象
create or replace type date_type as object (
i number,
dt date
);

--创建table对象,联合数组
create or replace type table_date_type as table of date_type;

--返回范围内的日期对象
create or replace function date_range(fromDate in date,toDate in date)
return table_date_type
as
curDate date:=fromDate;
tableDate table_date_type:=table_date_type();

begin
while curDate<= toDate
loop
tableDate.EXTEND;--扩展数组空间
tableDate(tableDate.count):=date_type(tableDate.count,curDate);--table.count 数组索引,从1开始
curDate:=curDate+1;
end loop;
return tableDate;
end date_range;
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
zack_kane
Java EE 67,535 成员 225,843 内容