Month: May 2005

Oracle to Ingres migrations

http://www.it-director.com/article.php?id=12729

I’m a bit curious about what the PL/SQL is being migrated to: you didn’t say. If it’s another proprietry format (albeit Ingres’ and therefore “free”) then who cares? Ok, less licence money but still not that good. I beleive the two proprietry languages aren’t that far apart anyway.

If it’s into Java or something else that is the lowest common denominator (albeit boring) I can see the point. I did once look at such a tool myself but had no time. You could also put it back into Oracle if you wanted to, which might be interesting if the app moved on and you needed to go back there; making the server-side app database agnostic is a very useful thing not just limited to Ingres.

Of course, MySQL has only just got database procedures and they are still beta (and pretty tame). Again a neutral language would be more use here.

Have you come across the Oracle wrap utility that can be used to pre-compile your PL/SQL and make it impossible to read? There are a lot of people out there who’d pay serious cash for a converter that could turn that output back into anything human-readable.

Increasing demand for open-source developers?

Letter to the Register in response to this
“There is an increasing demand for high-value, high-paying jobs that require skills in open standards technologies like Linux,…” – what does she base this on? Where is the research?

Nope, I’m still working on the old Oracle technologies (not even Java) on windows, despite the fact that I know the new stuff quite well and am a Unix hacker from way back. The Unix stuff has always been faster and easier to work with, but not many people were using it.

A casual perusal on skillsite and gisajob of the jobs using stuff like PHP, Python etc. shows that the salaries are 2-5k lower than mainstream products, usually for small companies, and there aren’t that many of them.

It’s the big corporations that can afford the big salaries and they buy Oracle, IBM etc.. Java has become popular but its popularlity is a function of how it is the lowest common denominator, rather than how powerful it is. Java development is what C development used to be; although it’s slightly quicker because there is so much out there that others have done but at the end of the day it is very slow going to do anything new.

Scare your users, Python

Hmmm

Just got asked to remove a feature I demoed over 6 months ago because it “scares” users. Relatively sophisticated way of refining a data set with a pop-up that allows you to refine the what you can see in a column on the web page, then add in other columns and restrict the query down a bit. Needed some work to make the displayed name of the column less technical but the principle was sound, in my opinion.

Suddenly is scares users and I have to scope it out.

I’m not fed up or anything. Honest. Just why did I bother?

Still having some problems with using onkeyup event on a field with Internet Exploding Trousers. Works fine with Firefox, can’t get to the bottom of it. Past caring to give an opinion.

Having fun learning Python. Also found a great book on Safari:

Oracle & Open Source
By Andy Duncan, Sean Hull
………………………………………..
Publisher: O’Reilly
Pub Date: April 2001
ISBN: 0-596-00018-9

Have worked through some of the examples for Python. It’s too easy to develop a client using Python. I’m beginning to understand the object model better.

Have fun, children

PLS-00307: too many declarations of ” match this call

I was getting this when I did the following:

l_session_info.set_attribute( render_context_portlet.g_roi_code_preference, null ) ;

This is because the procedure is overriden with multiple data types. When you give it a null it doesn’t know which of the overriden procedures you are calling and can’t resolve it.

Instead I put

l_session_info.set_attribute( render_context_portlet.g_roi_code_preference, ‘’ ) ;

and all was well. If you want it to go to a date type then you need to_date(’‘)… you get the idea.

The really strange thing is that ’’ is null for all other intents and purposes. You can’t get its length – all you get is null. But it seems to be a null with a varchar type.

You can’t say

if x = ‘’
then …

either. It always returns false because ’’ is null.

MySQL, Python, etc.

MySQL

Decided to move my project to MySQL because it seems to be more of a standard compared with Postgres. This is a pity because I like Postgres a lot, but you have to go with the flow and if I’m going to work on some non-Oracle skills I should at least go with the market leader.

So, got it installed on XP (which was a breeze). Read the manual through a couple of times (you can download a compressed HTM help file). Persuaded PHP to talk to it, which mainly consisted of placing the MySQL bin directory in the path and rebooting.

Worked out that I needed the INNODB table types so that foreign keys would work (you can default this using the excellent configuration utlility). Also discovered that (assume table jim exists for the sake of this discussion):

create table fred
( x varchar(2) references jim(x) ) ;

Does not work:- it accepts the syntax but does not create the foreign key. I had to hack my SQL generator to get rid of the Oracle shorthand and to not use domains (as I was using with Postgres) but translate them into raw types. Now it’s:

create table fred
( x varchar(2) ) ;
alter table fred add constraint fred_jim_fk (x) references jim(x) ;

Which should work in Oracle and Postgres anyway. I’ve decided to eschew using domains (although my software lets you define them) so that it can be portable around many SQL engines. Need to also drop the Oracle-ism varchar2, as it is now a synonym for varchar anyway. I believe that when Oracle first created the type it wasn’t done right so they had another go; hence the 2 on the end for compatibility reasons and then it stuck. I wonder how many petabytes of storage are taken up with all of those 2’s? Someone pointed out to me that a single-character field should be char(1), because you’re storing extra space for the length, which is pointless when you only have one character …

All in all fairly painless.

If you’re an Oracle supporter, read this:

I found it interesting that the Census Bureau had an Oracle site licence and chose not to use it. One of my buddies uses MySQL a lot and is looking at using the text extensions to replace Oracle’s context (or whatever they are calling it now) becuase Oracle want loads of cash and context is a pain in the proverbial. MySQL is also a bit quicker for complex queries and doesn’t have so many common(ish) words that are used as keywords that you have to pre-process into a form that isn’t interpreted as one, how lovely and user-friendly- those context guys really put some thought into it, didn’t they? Apparently every term added to an Oracle query increases the time taken for the query, where MySQL has what seems to be a fairly fixed cost. Don’t quote me on this I haven’t validated this for myself (but it doesn’t surprise me). Don’t say the words “memory leak” or “restart your database every morning” either. (I think this is 8i – maybe fixed?)

I’m quite curious about how their spatial database stacks up against Oracle’s but don’t have the time to look into it. The beauty of it is, of course, that you could add things in if you wanted to, with it being open source. Hmm … who the has the time, though?

Every database vendor other than Oracle allow you to define auto increment columns and then programatically get back the last autoincrement created in that session. Oracle sequence thing is a poor cludge. I suspect you could simulate the autoincrement with a packaged procedure (caching the last sequence number and messing with the insert statements or some horrible trigger), but why don’t Oracle do this?

MySQL doesn’t let you create views with subqueries in them. Not sure why, I’d have thought it fairly easy to implement. Views are just strings you run together with whatever you’re joining them to; or am I being naive?

MySQL 5 (which isn’t stable yet according to the website) has procedures and triggers. Postgres already has them. I just wish there was a standard for these languages so I don’t have to learn them all. I think MySQL’s look Postgresy but don’t want to do in-database stuff at the moment because it isn’t portable so don’t care about this. But I do like triggers for policing complex relationships and auditing.

Python

Sort of keeping a watching brief here. Was going to look at using Ruby as my scripting language of choice but it’s not mainstream enough to want on a CV. I like Python’s clean syntax. I like Ruby’s power and the syntax is OK. They have a lot in common as well (PHP has too). I suspect that when the Open Source guys see a good idea in another language they nick it, starting with variants of a lot of the good things in PERL. On first inspection I think Python’s object model is poor, but maybe what I’m seeing is flexibility. PHP 5 has a very strong one, as does Ruby (everything is an object in Ruby). It does have lambda functions (see http://diveintopython.org/power_of_introspection/lambda_functions.html). Lambda functions are very useful and give you a lot less clutter and overhead, if you use them carefully. Sharp tools, sharp tools. Love ‘em.

Professional Development

Have decided to spend 3 months on my PHP project and then go back to the Java Certification route. Java may be a boring thing to work with but at least it gives me options. Options are where it’s at. I think that Python or PHP or Ruby are probably a lot faster than Java in terms of bangs per developer buck and getting the job done with less fuss (I haven’t the space here to critique Java) but Java’s what the IT manager types want because it’s safe. Probably not as safe as .Net, but pretty safe.

Sheds and bookcases

Finally got my bike shed built in the back yard. Annoyingly it will only take 3 bikes and we have 4. Ho hum. I bought a new bookcase on Friday to replace one that fell to pieces one day. Guess what? I thought I’d got a wide but low one and in fact got a narrow low one that is about a quarter of the capacity I needed. Ah well back to IKEA and get another. Ho hum …

Onward … blessings all. I need some sleep.

Open Source

Lots of competent people, who think carefully about the problem, making small contributions is how it works. Don’t knock it. I’m a bit jealous of people who have made a contribution, which I know is weird of me. At times I feel like I’m trying to do a Michelangelo on the ubiquitous slab of marble, and not being allowed to find David, more like a badly-executed urinal without a drain hole.

(ClamAV) I need to get some up to date AV on my home machines. Was going to look at the OS stuff partly ‘cos I’m a tight wad and mostly ‘cos I want to support the OS movement.

I intend to make the Pharmarketeer stuff OS (collaborative evidence-based marketing – something like that). I’m trying to keep myself under control at the moment and do all of the work on pencil and paper until I’ve really thought through what’s required. Then I could make it into a book and get some residual from the book and consultancy work, just a thought. The move to MySQL is going slowly because I can’t connect to the database. Should have that cracked soon.

Ah well, back to me slab…

Software Patents

In response to http://www.it-director.com/article.php?articleid=12700

This seems a very bad caricature of the open source view. The way I understand it is that the ideas behind the software can be patented rather than just the software itself. So, for example, you come up with a means for managing some resource that is very efficient and write some software to do it, no-one else can use that idea without paying you, even if they implement it completely differently and do a much better job.

There are a whole ruck of ideas (linked lists, relational databases, hashed indexes for example) that are fundamental to working in a modern IT infrastructure. Where would Oracle (or MySQL) be if IBM had fought a patent over SQL – it could never have become the standard it is. How would this make the world a better place?

We cannot identify what ideas around today are as fundamental for the next wave of technology. It is totally naive to support patenting things like algorithms and good ideas. Profit comes from being better and quicker than your competitors. Profit is at the edge of things, where you are ahead of your competition, where you use sharper and better tools than they do.