- Sequence中cache的影响,每新建一个连接,next value值增加increment * cache.如果加上order,则会按顺序生成值.
1 create sequence myseq start with 5 increment by 5 cache 100; 2 3 Connection1 4 5 values next value for myseq; 6 7 5 8 9 values next value for myseq; 10 11 10 12 13 Connection2 14 15 values next value for myseq; 16 17 505 18 19 Connection3 20 21 select next value for myseq from sysibm.sysdummy1; 22 23 1005
1 create sequence myseq cache 10 order; 2 3 Connection1 4 5 values next value for myseq; 6 7 1 8 9 Connection2 10 11 values next value for myseq; 12 13 2 14 15 Connection1 16 17 values next value for myseq; 18 19 3
- Unit of Work的特征之一是一系列可以恢复的操作
- 用户调用UDT需要DB2 EXECUTE权限
- 取消所有DML权限:REVOKE ALL ON TBL FROM USER A
- CREATE VIEW V1 AS SELECT A FROM T WHERE C > 100 WITH CHECK OPTION。其中WITH CHECK OPTION的作用是使得所有插入更新V的值都必须满足C>100。
- TABLE可以被显示的lock,可以在LOCK语句中指定。