PrepAway - Latest Free Exam Questions & Answers

What is the effect of the CHECK OPTION clause?

A view is created with the following statement:
CREATE VIEW v1
AS SELECT col1, col2, col3, col4
FROM t1
WHERE col4 > 1000
WITH CHECK OPTION
What is the effect of the CHECK OPTION clause?

PrepAway - Latest Free Exam Questions & Answers

A.
Any row inserted or updated through view V1 must meet the condition that col4 > 1000.

B.
From now on, any row inserted or updated in table T1 must meet the condition that col4 > 1000,
but existing rows in the table are not checked.

C.
At view creation, DB2 will check the data in table T1, and if in any row doesn’t meet the
condition col4 > 1000, the view creation will be rejected.

D.
Any row inserted or updated through view V1 must meet the condition that col4 > 1000 and no
row in table T1 can be updated such that col4 <= 1000, but new rows in the table can be inserted
with col4 <= 1000.

2 Comments on “What is the effect of the CHECK OPTION clause?

  1. Chow, Kenneth KY says:

    WITH CHECK OPTION on a view
    WITH CHECK OPTION is an optional clause on the CREATE VIEW statement. It specifies the level of checking when data is inserted or updated through a view.

    If WITH CHECK OPTION is specified, every row that is inserted or updated through the view must conform to the definition of the view. The option cannot be specified if the view is read-only. The definition of the view must not include a subquery.




    0



    0

Leave a Reply