PrepAway - Latest Free Exam Questions & Answers

Which value will be returned by the query?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
20

B.
25

C.
50

D.
55

2 Comments on “Which value will be returned by the query?

  1. Chow, Kenneth KY says:

    CACHE integer-constant
    Specifies the maximum number of sequence values that are preallocated and kept in memory. Preallocating and storing values in the cache reduces synchronous I/O to the log when values are generated for the sequence.
    In the event of a system failure, all cached sequence values that have not been used in committed statements are lost (that is, they will never be used). The value specified for the CACHE option is the maximum number of sequence values that could be lost in case of system failure.

    The minimum value is 2 (SQLSTATE 42815). The default value is CACHE 20.




    0



    0

Leave a Reply