January 28, 2003
Implementing a tree in SQL
Recently on the agile databases mailing list someone raised the spectre of implementing a hierarchy in a relational database. Someone then almost reflexively talked about Joe Celkos set based approach to implementing a hierarchy.
Now I like a parent-child table but I like to think I am open to new ideas. But this one does rather hurt my brain. I can see how easy it is to traverse an existing tree, but it looks very hard to populate the left and right values. As far as I can tell each time you add or remove a node from the tree you have to recalculate the left right values for each node in the tree. Which looks rather hard to me.
Still, I am going to do my best to get to the bottom of it and try and implement it in one of my databases.
January 24, 2003
Oracle v SQL Server, Part 7
OK, I will admit it, this frightens me. It is saying, in effect, to not run any form of processing in the database.
I can attest to the truth of this though. I wrote a batch update script in T-SQL and started it up on our database. Twenty four hours later it was still running. So we killed it. After looking at this paper I figured that whilst I may be able to optimise my script it would still take an age to run.
So I stripped out the SQL statements and re-wrote the logic in Python. It then took fifteen minutes to run.
There is a lesson to be learnt here, but I cannot bring myself to believe that T-SQL is really that bad. Or is it?
January 22, 2003
Oracle v SQL Server, Part 6 and a bit
Lo and behold, dBforums - Equivalent of Oracle's DECODE function on SQLServer. I love Google
Oracle v SQL Server, Part 6
Not easy to find, but the equivalent of NVL in T-SQL is the function ISNULL. [Courtesy of SharePoint Portal Server]
I still can't find a direct equivalent for DECODE, but I shall continue to look.
January 21, 2003
PythonCard is a GUI construction kit for building cross-platform desktop applications on Windows, Mac OS X, and Linux. The latest release includes over 40 sample applications and tools to help users edit and build applications in Python. Check out the sample pages for screenshots and info about the samples.
January 20, 2003
Raw Strings on Windows
In both gadfly and my utilities I have been having all sorts of problems. Mainly because I have directory names which start with t, resulting in "\t" characters in my file name strings. This is not a good thing.