首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

利用oracle的存储过程兑现在sys_sequence表中的多个的自动增长ID的多线程同步解决方案

2013-03-26 
利用oracle的存储过程实现在sys_sequence表中的多个的自动增长ID的多线程同步解决方案利用oracle的存储过

利用oracle的存储过程实现在sys_sequence表中的多个的自动增长ID的多线程同步解决方案

利用oracle的存储过程实现sys_sequence表的自动增长ID的多线程同步解决方案

 

sys_sequence表结构

利用oracle的存储过程兑现在sys_sequence表中的多个的自动增长ID的多线程同步解决方案

sys_sequence表中的记录

利用oracle的存储过程兑现在sys_sequence表中的多个的自动增长ID的多线程同步解决方案

 

 

create or replace procedure get_sequence(key in varchar2) return number ret_val sys_sequence.lastid%type;begin update sys_sequence set lastid = lastid + 1 where code = key; if sql%notfound then insert into sys_sequence(code, lastid) values (key, 1); end if; select lastid into ret_val where code = key; return ret_val;end;/

我的异常网推荐解决方案:oracle存储过程,http://www.myexception.cn/oracle-develop/177537.html

热点排行