DB2 Duplicate Key Debugging

If you’ve ever gotten a DB2 error like this…

SQL0803N  One or more values in the INSERT statement, UPDATE statement, 
or foreign key update caused by a DELETE statement are not valid because 
the primary key, unique constraint or unique index identified by "1" 
constrains table "XX.TABLE_NAME" from having duplicate values for 
the index key.  SQLSTATE=23505

You may be asking yourself, but exactly which unique index is causing the problem?

Use the info from the error along with this query to find out:


Of course you will want to replace the WHERE clause conditions with your values.

Weekly Round-Up: 11/17/13 to 11/23/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 11/18
12 Powerful Habits Of Happy Relationships – http://mjg2.net/l/1881

Weekly Round-Up: 11/10/13 to 11/16/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Tue 11/12
Consumerism In America: How Your Stuff Is Killing You And You Don’t Even Know It – http://markjacobsen.net/l/1877

Wed 11/13
10 Things Every Couple Needs To Stop Doing – http://markjacobsen.net/l/1878

Thu 11/14
Working Long Hours Is Like Working for Free – http://markjacobsen.net/l/1879

Fri 11/15
Marriage Isn’t For You – Great article by @SethAdamSmith – http://markjacobsen.net/l/1880

Mind lending a hand?

Thanks ahead of time to everyone who’s already taken a moment to help out, but if you haven’t had the chance yet I’d appreciate your assistance in giving me just a few clicks. Since one of the most important signals to search engines for “recommending” sites when you do a search is social media presence, I was hoping you might be willing to lend a hand by giving my company, Communication Freedom, a link little juice.

Just visit the various sites below and like, follow, or circle it from your account. Don’t worry, I won’t start sending you a bunch of spam 🙂



Google+ (be sure to “Follow” and “+1”)


How to tell if a Perl Module is Installed

Want to check if a perl module is installed on your system? There’s a oneliner for that! Here’s an example…

perl -e "use Text::CSV"

… which would of course check if Text::CSV could be loaded. If it can, nothing will be printed. If not, you’ll get an error with some possibly useful information to figuring out why not.