DB2 Blog

A short description about your blog

Management and Communication

Posted by: Martin Hubel in Untagged  on

An example was given recently that a Director was recently so unhappy with their IT progress and strategy that one of two things were likely to happen:

1) Fire the CIO

2) Outsource IT

This is telling on many fronts. Also, it is not just a CIO problem. There is a breakdown in communication, a misunderstanding that spending money can automatically solve a problem, and that the business needs and vision is not understood or communicated by either the CIO or the Director. This is a common recipe for expensive mediocracy.

In that communication is a 2-way street, there was no meeting of the minds. Did the Director accept terminology without asking for an explanation in business terms? Did the CIO make an effort to understand the needs of the Director and the organization?

It surprises me that IT spending today continues without clear actionable objectives tied directly to business objectives. I'm certain that discussions were held and plans shared and discussed, but somewhere along the line, the IT costs and the benefits to the organization get out of sync.

There are many solutions presented by the myriad IT vendors. The solutions point to the need to solve problems or take advantage of opportunities through the purchase of products and/or services. If there is no clear definition of how the problems or opportunities really affect the organization, time, money and organizational energy is wasted. Some measurement of success also needs to be defined.

Outsourcing will solve nothing for the Director. In fact, it may exacerbate the issues around communication and understanding of IT issues. With information and its appropriate use as key items for organizational success, there is no guarantee that these can or will be more easily met via a formal agreement with a third party and contratratual SLA. Indeed, the formal nature of contractual arrangements rarely if ever speed up delivery or encourage innovation. Simply put, outsourcing is an abdication by management of IT strategy.

The bottom line is that Directors/CEOs need to understand enough about IT to manage it, and CIOs need to understand the business such that the goals of IT help the organization and support business objectives in the best way possible.

(c) Martin Hubel 2009


Home at last

Posted by: Martin Hubel in Untagged  on

After a busy month of conferences, it's good to be home. It was fascinating to see Warsaw for IDUG Europe; it was my first trip there.

From my limited knowledge of history, Poland has the unfortunate placement of being on the way to other destinations. When Napoleon, and later Hitler, want to go to Russia with a few hundred thousand soldiers, Poland was on the way and was invaded each time. Chopin wrote many sad songs about what was happwning to his beloved country. Of course, the Russian came through again when they later attacked Hitler.

We took time off on the last day of the conference to visit Warsaw's old town and the Royal Palace. We were told that it wasn't the original palace; the original palace was completely destroyed by the Nazis, and then the rubble was mined for other construction. There were few buidlings left standing in Warsaw.

It took Polish volunteers ten years to reconstruct the palace. My hat is off to them. The palace is as close to perfect as it can be, and it is lovingly maintained. I spent a few minutes watching an artisan repair a small section of gold leaf. It is painstaking work.

My second trip was  back to Mandalay Bay in Las Vegas for IOD and the Gold Consultant briefing. I felt in somewhat better shape for the 5+ miles of walking required.

If you are ever looking for a quiet spot on the Vegas strip, I highly recommend a small pond in the middle of the Wynn Hotel. The bar serves a nice riesling and you can pretty much forget the bustle around you. It's a short 1 1/4 hour walk from Mandalay Bay.

Home time is limited by IDUG regional events. I'm now off to San Ramon CA and the following week is Harrisburg PA and Kansas City KS. 


I provided a sample procedure written using SQL/PL earlier to check if a string contained only numbers. This is a common validation for input strings.

SQL UDFs cannot contain any commands that are outside the scope of the SQL reference. DB2 will take an SQL UDF and stick it directly into the calling SQL, so that when it's executed it's indistinguishable from the
rest of the SQL statement, as far as DB2 is concerned.

On the other hand, an SQL Procedure is a separate entity that contains it's own set of information specific to it's execution. As such, the SQL/PL language has directives that are NOT found in the SQL reference, as they are specific to the procedure processing. "DECLARE EXIT HANDLER" is one of them.

Also, stored procedures create a package. For the example MP1, the specific name is SQL080109124101300, as found in SYSCAT.PROCEDURES. The generated package name from Data Studio is P2410137. A bit of detective work was required to find how this name was created.

The package was created at 2008-01-09 12:41:01.377. So the package name was pulled from the middle of the timestamp, starting with the second digit of the hour to the hundredths of a second.


So, we want to post a sample for this blog from the db2diag.log. That's great; it's nice to have samples. The problem is finding the location is you took the default.

First, you must set hidden files on. From my C: drive in Windows Explorer, I pressed the Alt key to see the menu bar. On the Tools Menu, choose Folder Options, and choose the radio button halfway down to show hidden files and folders.

Then, you'll be able to see diag information in:

C:/Program Data/IBM/DB2/DB2COPY1/DB2


A customer asked me to develop a function to check whether a character string was in fact numeric with the further stipulation that it be done in SQL. He reported that the documentation seemed to be lacking.

The DB2 LUW Information Center used to have a Reference section, where you would find the SQL statement reference along with everything else. This has been reorganized in DB2 9.5 to have a "Database Fundamentals" section. You will find the SQL reference information in there.

I figured the easiest thing to do would to use an exception handler. Unfortunately, the documentation provides nothing in the list of topics. The best example I could find was in the IF statement in the SQL section. (IF statement you say: "Of course!") There is almost nothing available for SQL/PL.

From snippets of code there, I developed this:

-- Invalid numeric character is SQLSTATE 22018
DECLARE not_num CONDITION FOR SQLSTATE '22018';
DECLARE EXIT HANDLER FOR not_num
SET smint = -1;
SELECT INTEGER(sTmp) INTO sTmpa FROM SYSIBM.SYSDUMMY1;

The next thing was I couldn't use this in a function. I'll write about functions and stored procedures next time.