Wednesday, September 19, 2007

VMWare vmmod.tar missing during installation

Yesterday I had to reinstall VMWare Workstation 6.0 on my Ubuntu 7.04 PC, and again I got stuck during the installation with the error about vmmod.tar not being found under /usr/lib/vmware/modules/source/

The solution is simple and widely publicized but still many people seem to sit with this problem.

Just create the /usr/lib/vmware/modules/source/ directory if necessary, then get the vmware-any-any patch from http://knihovny.cvut.cz/ftp/pub/vmware/ (e.g. vmware-any-any-update113.tar.gz) and run the runme.pl to continue the installation.

Thursday, August 23, 2007

Oracle treats an empty string as NULL

As a Microsoft SQL / MySQL developer I was surprised to find out today that Oracle doesn't support empty strings in "NOT NULL" fields! This is because Oracle treats an empty string, i.e. '', the same as NULL.

Of course this is old news to Oracle users, but even some of my colleagues who'd been using Oracle longer than me were unaware of this.

I realized this after trying to figure out why an INSERT statement like the following kept complaining that column B cannot be NULL:

insert into MYTABLE ( A, B ) values ( 'hello', '' )

I think that's not very clever at all.

That means, for example, if your code performs a search on a field, the following can never work:

select * from MYTABLE where B = :value

if the :value parameter is an empty string, since you'd have to say "where B is null" instead.

Google "oracle empty string null" for more descriptions.