my face
About Me

Published Posts

All Posts

New Post


View by Tag:

interviewing, code, testing, philosophy, blog, wantmyjob, virtualization, railsmud, heroku, ruby, published, neoarchaeology, railsgame, rails, juggernaut, astrino, cheaptoad, shannaspizza, mongodb, refactorit, devise, rvm, passenger, jruby, programming, vagrant, chef, railsframe, business, codefolio


Online Portfolio

Resume

Profile on LinkedIn

Recommend me on WorkingWithRails: Recommend Me

DB2 CREATE DISTINCT TYPE WITH COMPARISONS

Posted: 17 months ago (2010-08-23 16:55:29 UTC )

At my workplace, we use DB2 primarily. We're attempting to solve a weird ActiveRecord incompatibility problem by defining a type. So far, so good.

However, "CREATE DISTINCT TYPE onsite.mytype AS INTEGER WITH COMPARISONS" isn't doing anything useful. By that, I mean you can't compare such an object to itself, even with the cute typecast functions they give you.

I don't have a solution to this problem. So far the user-defined types we can make are simply useless. Statements like "select 1 from dual where onsite.mytype(0) = onsite.mytype(0)" fail completely because you can't compare a mytype to a mytype, even if you specify WITH COMPARISONS.

And yet nobody seems to have blogged about this. Anywhere. Is that because DB2 is only used in corporate settings, and people like that are desperately afraid of giving away corporate secrets if they blog about it?

Your secret's out already, guys. We know you're too cheap to pay for Oracle. Blog already.

Incidentally, the DISTINCT and WITH COMPARISONS parts seem to be mandatory. It won't even parse without them (as you'd expect with DB2, there's a five-digit error code with a cryptic description). You'd think they would, like, document that. So the documentation is terrible, people are required to use the product for their jobs, and there are no blog posts anywhere as guerilla documentation. Seriously, how is that possible?

Previous: RVM and Passenger / Next: Away, and Roxio Back-On-Track

Edit | Destroy | See All Posts

blog comments powered by Disqus