Database Error

Get All details of CASE_DETAILS Table: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

using query “SELECT * FROM “+DB_Name+”.case_details ;”;
(ran same query in workbench able to get the table but from studio giving the error)

@madhavraichur25,

Instead of SELECT * , try selecting specific columns one by one and check which columns is causing this issue. Finding this will help you to find the real root cause.

2 Likes

Also, just in case it would be this stupid of an issue, please make sure you use this:

"SELECT * FROM "+DB_Name+".case_details;"

instead of:

“SELECT * FROM “+DB_Name+”.case_details ;”

It is most likely not it, but I have this reaction any time I see those and quotations marks :sweat_smile:

2 Likes

thank you this helped with the bot

1 Like

Print the query in the console and manually verify it against the database. This approach will help you construct a precise and error-free SQL query while ensuring it meets your expectations.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.