I am struggling with a problem and I hope someone could help a brother out.
I tried INSERT INTO but got an error message: Error Code: 3819. Check constraint 'inventory_chk_1' is violated.
To troubleshoot the issue, i want to examine the specific check constraint named "inventory_chk_1" to understand the condition it enforces and I tried this:
SELECT constraint_name, check_clause
FROM information_schema.check_constraints
WHERE constraint_schema = 'book_shop'
AND table_name = 'inventory'
AND constraint_name = 'inventory_chk_1';
I get yet another error: Unknown column 'table_name' in 'where clause'. Then i tried this:
SELECT constraint_name, check_clause
FROM information_schema.check_constraints
WHERE constraint_schema = 'book_shop'
AND table_name = 'inventory'
AND constraint_type = 'CHECK'
AND constraint_name = 'inventory_chk_1';
and so on and on..
Can someone point what my mistake might be?
Much appreciated!
I tried multiple modifications of the code but none worked. I want to solve the issue!