Download DB2 Upgrade DB2

The Importance of Separating Separators

February 28th, 2007 by Leons Petrazickis

I ran into a problem running a simple test xquery. I hadn’t directly dealt with XML namespaces in xquery prior to this, but the documentation was clear enough:

XQUERY
declare default element namespace "http://posample.org"
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x

Oops, EOF error. It needs a terminator.

XQUERY
declare default element namespace "http://posample.org"
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x;

Unexpected “for” following the namespace declaration? Pardon? It turns out xquery prologs need to be terminated by a semicolon:

XQUERY
declare default element namespace "http://posample.org";
for $x in db2-fn:xmlcolumn(”PURCHASEORDER.PORDER”)
return $x;

Unexpected “http://posample.org”? But that’s the exact syntax given in the examples! Alas, this semicolon is distinct from the usual semicolon separator in SQL. It’s part of a single xquery statement, so what I need to do is change the SQL separator to something more exotic. This will allow xquery to be parsed correctly:

XQUERY
declare default element namespace "http://posample.org";
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x@

Eureka.:)

Posted in db2 | 1 Comment »

Bless you, UltraCompare

February 21st, 2007 by Leons Petrazickis

The project I’m working on uses source control, but due to unfortunate circumstances it acquired a major fork over the span of a couple months. Today, it fell on me to merge it. I’d have had to go through each file and compare the two versions. Gggg.

I stumbled on the (already installed but unregistered) UltraCompare in the right-click menu just in time. It could do something I didn’t expect — compare whole directory structures to each other. It told me which file was newer, and it batch-merged either way. Instead of a couple hours, merging a forked project took me a couple minutes. Whew.

UltraCompare

Posted in apps | 1 Comment »

A major error occurred while installing

February 20th, 2007 by Leons Petrazickis

Swapping Zend Core and the beta of Zend Core 2 around, I got my computer to a state where DB2 would not run, would not uninstall, and would not reinstall. Zend had hosed my DLLs/registry/environment in some unknown way.

Digging around turned up that, for times when the graphical uninstaller fails, there is a command line one that always works:
db2unins - Uninstall DB2 database product command

I’m not entirely clear on why they didn’t just fix the graphical uninstaller instead of writing a second one. Still, db2unins -f cleaned my system, allowing me to reinstall DB2 and remap existing databases.

Posted in db2 | No Comments »

Using Ajax with DB2 and Dojo

February 15th, 2007 by Leons Petrazickis

DeveloperWorks has published my latest magnum opus, [Develop a Web application] using Ajax with DB2 and Dojo. Alas, they editors awkwardly doubled the title’s original length. Hmm.

Neither do I remember vetting the pre-login page. I thought the first page would be the pre-login page — that’s why I placed so many juicy things on it. I thought the idea was to dangle a carrot before hitting with the stick of registration, not to play hard to get. Oh, well. I hope the juicy things prove a satisfactory reward.;)

Posted in ego | No Comments »

Mapping existing databases after reinstalling DB2

February 12th, 2007 by Leons Petrazickis

Due to the vagaries of software, I had to reinstall DB2 on my laptop. Unfortunately, the existing databases were not automatically added to the Control Center.

Physically, DB2 stores its databases in a directory similar to C:\DB2\NODE0000. Logically, there must a way to remap them. So, how does one remap them?

To list databases stored at a path:
% db2 list db directory on c:

To recatalog them:
% db2 catalog db SAMPLE on c:

Reference:
DB2 at a Glance | The DB2 Environment

Posted in db2 | 1 Comment »

Javascript Smorgasboard

February 8th, 2007 by Leons Petrazickis

In addition to the PHP Performance link from yesterday, I just added four related to Javascript to the sidebar.

The Opera browser developers came up with some very good advice for making your Javascript run smoothly.

Around the same time, Internet Explorer 7 folk wrote a three part series on the same subject.

Both are rather illuminating.

Posted in links | 1 Comment »

When all you have is a hammer, perhaps you should contemplate acquiring a table saw

February 6th, 2007 by Leons Petrazickis

I had a an application that parsed an XML document and transformed it into a dojo.widget.Tree. This is how long it took with documents sized 15k, 34k, and 93k:


IE6 IE7 Firefox2 Opera9
15k 24 6 11 6
34k 69 11 21 21
93k 157 124

“Hmm,” I thought. “I don’t really need it to be collapsible or fancy. What if I replace the tree with a sequence of nbsp-indented lines and put that in via innerHTML?”


IE6 IE7 Firefox2 Opera9
15k 5 6 4 3
34k 14 11 19 10
93k

Then Internet Explorer 6 doesn’t look as pathetic as it is.

But why am I doing data munging in Javascript? The browsers seem to very unhappy about loading 93 kilobytes of XML into DOM. Would it be faster in PHP?


IE6 IE7 Firefox2 Opera9
15k 1 1 1 1
34k 1 1 1 1
93k 5 2 6 3

Yes. Yes, it would. 80x faster, in fact.

In conclusion, currently PHP is far faster for hundreds of kilobytes of data munging. Javascript is optimized for something else entirely — page management. Use it to move data around, but don’t transform with it.

Posted in javascript, php | No Comments »

Linkage

February 6th, 2007 by Leons Petrazickis

FastCGI for IIS - Make PHP faster on Microsoft’s server.

Antonio Cangiano | Put DB2 Info Center in your browser search bar

Posted in links | No Comments »

PHP Smorgasboard

February 5th, 2007 by Leons Petrazickis

Links

Atomized | PHP Performance Best Practices - Informative.

Installing PEAR and PECL on Zend Core for IBM

  1. Save http://go-pear.org/ to go-pear.php (in, say, C:\Program Files\Zend\Core for IBM\pear)
  2. Open Command Prompt
  3. % cd “C:\Program Files\Zend\Core for IBM\pear”
  4. % ../bin/php go-pear.php
  5. Follow the steps and let it modify your php.ini
  6. Restart your Apache

Installing the profiling packages mentioned in Best Practices

  1. % pear install Benchmark
  2. % pecl install apd

Posted in php | No Comments »