互联网服务数据库

730考试的一道考题,请问正确答案是多少?

A sequence was created with the DDL statement shown below:CREATE SEQUENCE my_seq START WITH 5 INCREMENT BY 5 CACHE 5User1 successfully executes the following statements in Connection1:VALUES NEXT VALUE FOR my_seq INTO :con1hvarVALUES NEXT VALUE FOR m...显示全部
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收起
参与9

查看其它 7 个回答IQHighest的回答

标准答案: D 55
:con1hvar 是主机变量.忽略这些次要因素吧.
如果做实验,不断连的话,出不来 55 这个结 ...
cedarbird 发表于 2010-5-20 12:01



即使连接断开,如果数据库还是保持active的话,应该也不会出现55的吧?新连接进入后,还会从已经缓存的序列值取,而不会重新再缓存了吧?
2010-05-20
浏览732

回答者

IQHighest 最近回答过的问题

回答状态

  • 发布时间:2010-05-20
  • 关注会员:1 人
  • 回答浏览:732
  • X社区推广