Hash

Entries tagged as ‘PostgreSQL’

Oracle to buy Sun Microsystems for $7.4 bn

April 20, 2009 · Leave a Comment

 

In a news today by CNN, Oracle confirmed it will buy Sun Microsystems for $7.4 bn. This also strengthens the belief that Sun refused IBM because it had a better offer.

Acquisition of Sun will be fabulous for Oracle because it can now enter in the servers market and that with a BANG! Sun’s powerful hardware and trusted Operation System ‘Solaris’ will be a huge plus for Oracle but the future of two most widely used open source relational databases remains uncertain. Sun has bought MySQL a couple of years ago and was supporting PostgreSQL as well. What is the use of MySQL for Oracle? And support for PostgreSQL will most probably be dropped.

Sun was a better buy for IBM anyway.

 

 


Share this post : digg it! Facebook it! live it! reddit! technorati! yahoo!

Categories: LifeFactor · TechFactor
Tagged: , , , , , , ,

Empty String vs. NULL Value in Oracle

January 20, 2009 · Leave a Comment

Today I was writing a query trying to eliminate NULL values and empty strings from a column. I found a strange behavior in Oracle that it considers NULL and empty strings ( ” ) equal which is not ANSI. Other database systems which are more compliant to ANSI like PostgreSQL differentiate between NULL and ( ” ) correctly.

Check this out:

SQL> create table tes (a varchar2(2));
Table created.
SQL> insert into tes values (''); -- inserted an empty string
1 row created.
SQL> select * from tes where a is not null;
no rows selected

Gives me no rows although it has a string with zero length in it.

SQL> select length(a) from tes;
 LENGTH(A)
----------

Even the length function shows a NULL it should have been saying “0″.

This brings another interesting scenario. What if you want to find out empty strings in your column?

SQL> select * from tes where a = '';

no rows selected

This does not bring in any rows because a NULL is not equal to NULL. The correct query would be:

SQL> select * from tes where trim(a) is null;
A
--

Now it brings in one row because the TRIM function returns null if no characters are left in the given string after trimming. A more ANSI compliant database would have returned an empty string ( ” ) though.

Categories: Oracle · PostgreSQL
Tagged: , , , , , ,