Oracle – for when it was like that when you got there

Main menu

Post navigation

Born Before Computers – fogey foibles and forsight for the humble insert

Apparently, I am considered by some to be stuck in my ways.
For example, Deb now refuses to stand with me in the supermarket queue because of my tendency to argue with the automated checkout.

This even extends into my working life where I have a colleague who is a bit more hip and with it when it comes to writing code.
The rest of us in the Oracle team – slightly older than this person it must be said – are apparently “BBC”.
This isn’t some reference to the venerable British Broadcasting Corporation, nor even to the BBC micro which was popular back in the 80’s.
Evidently, it is something of a disadvantage to have been “Born Before Computers”.
I’ll confess, I do write most of my database code in a text editior and run it via SQL*PLUS. Whilst I use an IDE for looking at stored database code, I’m not that keen on using it as a code environment.
As is usually the case, sometimes things are done in a certain way for years because that’s the best way to do it…and sometimes it’s simply because “that’s how we’ve always done it”.
The trick is, knowing which is which.

Unsurprisingly, it hasn’t picked up the change in the column order so we now have data in the wrong columns. This is otherwise known as a great big mess. Especially if you don’t spot it for a while and then have to unpick it all.

The code is undoubtedly more robust in terms of not breaking when we change the structure of the underlying table, but is that really ALWAYS what we want ?
Whilst this procedure will not fail after adding the column, it will NEVER insert a value into the new column.

This is just one of the reasons that doing an impact analysis is a pretty good idea before making structural changes to tables.
The simplest way to do this is :

Conclusion

As so often, a little bit of extra effort on the keyboard when writing code can save lots of time and pain down the line. Remember, there’s no reason to suppose that the code you are writing now won’t still be in production years down the line. There’s also the chance that you might have to come back to this code at some point in the future and try and work out exactly what it was you were trying to do.

Anyway, I’m off to skulk around the supermarket again. Deb has refused to let me liven things up by bringing a lump-hammer to be my “Unexpected item in the bagging area.”
Apparently that’s not the done thing.
Honestly, some people are so stuck in their ways !