当前位置: 代码迷 >> DB2 >> 求解730里面一道关于sequence的题目,该怎么解决
  详细解决方案

求解730里面一道关于sequence的题目,该怎么解决

热度:8308   发布时间:2013-02-26 00:00:00.0
求解730里面一道关于sequence的题目
Q: 14 A sequence was created with the DDL statement shown below:

CREATE SEQUENCE my_seq START WITH 5 INCREMENT BY 5 CACHE 5
User1 successfully executes the following statements in Connection1:
VALUES NEXT VALUE FOR my_seq INTO :con1hvar
VALUES NEXT VALUE FOR my_seq INTO :con1hvar
User2 successfully executes the following statement in Connection2:
VALUES NEXT VALUE FOR my_seq INTO :con2hvar
After User1 & User2 are finished, User3 executes the following statement in Connection3:
SELECT NEXT VALUE FOR my_seq FROM sysibm.sysdummy1
Which value will be returned by the query?
A. 20
B. 25
C. 50
D. 55

这道题的答案给出是D,应该如何解释。我在自己的环境上模拟的3用户3次connection得出的结果是A啊,答案是错误的么

转载请注明源自www.DB2China.net,请保留版权. 
原文地址:http://www.db2china.net/club/thread-7054-1-1

------解决方案--------------------------------------------------------
就是做完一个断开一个的连接
到连接3的时候就是55
  相关解决方案