• Post Reply Bookmark Topic Watch Topic
  • New Topic

constraint violation  RSS feed

 
Grace Green
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a constraint violation when inserting a record in a table.
So, I dropped the constraint in question since the intent is to be able to insert multiple records.

alter table table_name drop constraint constrain_Name

I look at the list of constraints for the table in question, the constraint has been dropped.

Still I cannot insert the record: same constraint violation comes up.

ANy ideas ?







 
Grace Green
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dropping the corresponding index resolved the issue
 
Scott Selikoff
author
Bartender
Posts: 4085
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are SQL commands you can perform to insert with the constraint disabled and then re-enable it after the insert. It's not generally a good practice, though, and I only use for bulk restoring of a database, ergo restoring 20 tables with thousands of records in a single script.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!