Ask Your Question
1

What is the reason for not being able to include CURDATE() in a check?

asked 2021-11-23 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-03-08 21:00:00 +0000

scrum gravatar image

The reason for not being able to include CURDATE() in a check is that CURDATE() is a dynamic function that returns the current date, and that value is not constant. CHECK constraints need to be based on static conditions that can be evaluated at the time of insertion or update, and the use of dynamic functions may lead to unexpected results as the condition may change over time. Therefore, it is recommended to use static values or expressions in CHECK constraints.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-11-23 11:00:00 +0000

Seen: 19 times

Last updated: Mar 08 '23