Tag Archives: DB2
DB2 Query Writing Best Practices
Problem Writing efficient SQL SELECTqueries for DB2 can be tricky. Some general SQL guidelines apply, and there are also specific practices that apply only to DB2. Solution Here is a list of tips you can use to write good SELECT … Continue reading
Creating a User Defined Function (UDF) in Java for IBM DB2 9.7
Intro One of the great features of DB2 is that it can be extended with custom code using SQL, C/C++, Java and COBOL. One of the great new features added to DB2 in 9.7 is the ability to run native … Continue reading
IBM Expands in Analytics Market
Infoworld’s Pete Babb has an article about IBM to acquire analytics firm SPSS. Pete sees this acquisition by IBM in line with the earlier acquisition of Cognos also by IBM. He underlines that the key aspect of this acquisition is … Continue reading
Connection pooling with mod_perl
I found this info in the PostgreSQL archives. Here are 2 methods: Best method from Dan Lyke: Apache::DBI will pool across Perl programs, and you don’t have to change anything in your scripts. Next best method from Gilles DAROLD: in … Continue reading
How to delete records with duplicate fields, such as dupplicate emails?
To delete records where only a field is duplicated, we can use a similar technique to the general duplicate removal technique: CREATE TABLE temp AS SELECT DISTINCT ON (email) * FROM table_to_deduplicate; DROP TABLE table_to_deduplicate; ALTER TABLE temp RENAME TO … Continue reading
How to delete dupplicate records in DB2, Oracle, MySQL, and PostgreSQL
To delete dupplicate records in SQL, the following sequence of commands will do the trick: CREATE TABLE temp AS SELECT DISTINCT * FROM table_to_deduplicate; DROP TABLE table_to_deduplicate; ALTER TABLE temp RENAME TO table_to_deduplicate; Be mindful of the fact that this … Continue reading
DB2 Client Install on Linux
Allowing client machines to connect to a DB2 database is not as simple as regular databases. If you are using a client application, such as a Java web application, usually the application server has what is needed to configure a … Continue reading
DB2 crashes when LOAD used on generated field
When trying to LOAD table data where one of the rows are generated, DB2 9.1 and 9.5 on Linux and AIX will crash if the generated field uses a user defined function (fenced or unfenced). IBM is aware of the … Continue reading
PostgreSQL to DB2 export conversion
PostgreSQL and DB2 use different styles of conventions to represent NULL. In PostgreSQL, the convention is to have “N” in the data to be loaded with the COPY command. In DB2, the LOAD command can be set to consider and … Continue reading
DB2 The maximum number of open files has been reached
After a fresh install of DB2 Express C (free download from IBM) 9.5.2 on Linux AMD 64bit, I got the following error trying to load some tables for testing: SQL3500W The utility is beginning the “LOAD” phase at time “01/22/2009 … Continue reading