In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to add validation constraints to the DB2 database, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
How to add validation constraints to DB2 databases
There is a foreign key in the table PARTICIPANT, which means that for each value in the PAR_ID column of PARTICIPANT, there must be a row in the MODULE table with the same MODULE_ID column value. Because the MODULE table is currently empty, this condition cannot be satisfied if you enter data into the PARTICIPANT table. Follow these steps to verify the constraint:
1. In Control Center, click the PARTICIPANT table, and then click Open. In the Open Table panel, click Add Row. Enter the lines shown below into the PARTICIPANT table and click Commit.
2. The message SQL0530N is returned, which indicates that the referential integrity requirements specified by the foreign key constraint are not met.
How to add validation constraints to DB2 databases
3. Click Close to close the message, and then click to close the Open Table window again.
4. Verify the check constraints that have been defined on the MODULE table. Because the check constraint ("CONSTRAINT MID_CHECK CHECK (MODULE_ID > = 0)") was established when the MODULE table was created, the MODULE_ID cannot contain negative numbers.
5. In Control Center, click the MODULE table, and then click Open. In the Open Table panel, insert a row with a negative MODULE_ID column value into the MODULE table and provide a name for MODULE_NAME. Try to insert and see what happens. The following error message indicates that this should not be done:
6. Click Close to close the message, and then click Close to close the Open Table window.
These are all the contents of the article "how to add validation constraints to DB2 databases". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.