Mybatis调用函数,返回联合数组的配置文件如何配置?
定义了一个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;
--创建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;
...全文
相关推荐
springboot配置文件和整合mybatis配置文件
springboot配置文件模板:包括多环境开发布置,端口号配置,全局jackson配置,mysql数据库配置,oracle数据库配置,连接池配置,redis配置,redis链接池的配置,设置上传文件大小限制配置,全局格式化时间配置,https证书配置示例
mybatis配置文件以及日志文件Log4j
十分宝贵的mybatis配置文件,包含最新的mybatis配置文件,以及mybatis开发文档,Log4j测试开发日志文件
详解MyBatis批量插入数据Mapper配置文件的写法
本篇文章主要介绍了详解MyBatis批量插入数据Mapper文件的写法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
Mybatis中执行String类型的自己拼写的sql,不执行配置文件中的sql
Mybatis中执行String类型的自己拼写的sql,不执行配置文件中的sql mybatis sql connection mybatis中使用sql,不实用配置文件中的sql实例
Mybatis增删改查实例(含联合查询)
一个入门级别的Mybatis 增删改查实例,包含多表联合查询,实体集合返回值。经测试可以跑通。


