????????????????????SQL????
???????????? ???????[ 2015/7/16 11:04:26 ] ?????????????
???????????????????CHECK??????????????????????????????Щ??????????????????????????????е??????????????????????????????????????2???Ч??
???????SQL?????WITH CHECK OPTION???????????????Oracle??SQL Server????????????????????????????
????CREATE TABLE books (
????id NUMBER(10) NOT NULL??
????title VARCHAR2(100 CHAR) NOT NULL??
????price NUMBER(10?? 2) NOT NULL??
????CONSTRAINT pk_book PRIMARY KEY (id)
????);
????/
????CREATE VIEW expensive_books
????AS
????SELECT id?? title?? price
????FROM books
????WHERE price > 100
????WITH CHECK OPTION;
????/
????INSERT INTO books
????VALUES (1?? '1984'?? 35.90);
????INSERT INTO books
????VALUES (
????2??
????'The Answer to Life?? the Universe?? and Everything'??
????999.90
????);
????????????????????expensive_books ????Щ??????100????顣????????????????飺
????SELECT * FROM expensive_books;
???????????????????
????ID TITLE PRICE
????-- ----------------------------------------- -------
????2 The Answer to Life?? the Universe?? and ... 999.9
?????????????????????CHECK OPTION????????????????”??????鼮”?в?????Щ???????????????????????????????
????INSERT INTO expensive_books
????VALUES (3?? '10 Reasons why jOOQ is Awesome'?? 9.99);
?????????????Ч??????????
????ORA-01402: view WITH CHECK OPTION where-clause violation
?????????????????????3??????
????UPDATE expensive_books
????SET price = 9.99;
????????????????????ORA-01402????
????WITH CHECK OPTION????
????????????????????????????????У?????????WITH CHECK OPTION?????????
????INSERT INTO (
????SELECT *
????FROM expensive_books
????WHERE price > 1000
????WITH CHECK OPTION
????) really_expensive_books
????VALUES (3?? 'Modern Enterprise Software'?? 999.99);
???????????????????ORA-01402????
???????SQL????????????????
????CHECK OPTION??????洢????????????????????Щ????????????????????????????????????????CHECK OPTION???????????SQL?м???????????ж??SQL???????
??????????????jOOQ??SQL???????????????????????????SQL????ж????????????????????????????DML????С??????????????б??????м????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11