mybatis oracle 建表语句吗,mybatis里的xml中的写添加的sql语句,怎么使用oracle数据库的序列...

/*drop table testtable;drop table testcode;*/create table testtable(id integer not null primary key,zt varchar2(10) null);insert into testtable values(1,'abc');insert into testtable values(2,'ab');insert into testtable values(3,'a');insert into testtable values(4,'c');insert into testtable values(5,'bc');/create table testcode(zt varchar2(10) not null primary key,dmlb varchar(100));insert into testcode values('a','字符串a');insert into testcode values('b','字符串b');insert into testcode values('c','字符串c');/create or replace function testtranslate(acode in varchar2) return varchar2 is  result varchar2(500);  i      integer;  c      varchar2(1);  v      varchar2(100);begin  result := '';  for i in 1 .. length(acode) loop    c := substr(acode, i, 1);    select dmlb into v from testcode where zt = c;    result := result || v || ',';  end loop;  if length(result) > 0 then    result := substr(result, 1, length(result) - 1);  end if;  return(result);end testtranslate;/select id,testtranslate(zt) from testtable;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值