<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Debugging on MarkJacobsen.net</title><link>https://markjacobsen.net/tags/debugging/</link><description>Recent content in Debugging on MarkJacobsen.net</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 26 Nov 2013 18:13:40 +0000</lastBuildDate><atom:link href="https://markjacobsen.net/tags/debugging/index.xml" rel="self" type="application/rss+xml"/><item><title>DB2 Duplicate Key Debugging</title><link>https://markjacobsen.net/2013/11/db2-duplicate-key-debugging/</link><pubDate>Tue, 26 Nov 2013 18:13:40 +0000</pubDate><guid>https://markjacobsen.net/2013/11/db2-duplicate-key-debugging/</guid><description>&lt;p&gt;If you’ve ever gotten a DB2 error like this…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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 &amp;quot;1&amp;quot; 
constrains table &amp;quot;XX.TABLE_NAME&amp;quot; from having duplicate values for 
the index key. SQLSTATE=23505
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You may be asking yourself, but exactly which unique index is causing the problem?&lt;/p&gt;
&lt;p&gt;Use the info from the error along with this query to find out:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT *
FROM SYSCAT.INDEXES
WHERE IID = 1
 AND TABSCHEMA = 'XX'
 AND TABNAME = 'TABLE_NAME';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Of course you will want to replace the WHERE clause conditions with your values.&lt;/p&gt;</description></item><item><title>Find the column causing a DB2 import to fail</title><link>https://markjacobsen.net/2013/10/find-the-column-causing-a-db2-import-to-fail/</link><pubDate>Wed, 16 Oct 2013 17:30:17 +0000</pubDate><guid>https://markjacobsen.net/2013/10/find-the-column-causing-a-db2-import-to-fail/</guid><description>&lt;p&gt;Ever run DB2 IMPORT and get a super helpful error like…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SQL0407N Assignment of a NULL value to a NOT NULL column &amp;quot;TBSPACEID=7,
TABLEID=265, COLNO=2&amp;quot; is not allowed. SQLSTATE=23502

SQL3185W The previous error occurred while processing data from row &amp;quot;126&amp;quot; of 
the input file.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After you calm down from wanting to smack a DB2 developer in the face, remember the syscat tables and run this SQL to find out the table and column giving you grief…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;select * 
from syscat.columns c
 inner join syscat.tables t
 on c.TABSCHEMA = t.TABSCHEMA
 and c.TABNAME = t.TABNAME
where c.COLNO = 2 
 and t.TABLEID = 265
 and t.TBSPACEID = 7
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Resolving Ant javac “class file has wrong version” issues</title><link>https://markjacobsen.net/2013/07/resolving-ant-javac-class-file-has-wrong-version-issues/</link><pubDate>Wed, 03 Jul 2013 15:10:11 +0000</pubDate><guid>https://markjacobsen.net/2013/07/resolving-ant-javac-class-file-has-wrong-version-issues/</guid><description>&lt;p&gt;Ever run an ANT build in eclipse and it works just fine, but as soon as you run it outside of eclipse you get something like…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class file has wrong version 51.0, should be 49.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The issue is likely that you need to “fork” in your javac task…&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before (with error)&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;javac srcdir=&amp;quot;${build.path}&amp;quot; 
 verbose=&amp;quot;true&amp;quot; 
 includeantruntime=&amp;quot;false&amp;quot; 
 includejavaruntime=&amp;quot;false&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;After (no error)&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;javac srcdir=&amp;quot;${build.path}&amp;quot; 
 verbose=&amp;quot;true&amp;quot; 
 includeantruntime=&amp;quot;false&amp;quot; 
 includejavaruntime=&amp;quot;false&amp;quot; 
 fork=&amp;quot;yes&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hopefully this can save you about 2 hours some day!&lt;/p&gt;</description></item></channel></rss>