ORACLE Transactions and Fishing on the Underground

It’s that time of year again. Yes, it is the season to be snotty.
“Man-flu”, was Nurse Debbie’s considered medical opinion. Admittedly, she’s feeling a bit under the weather herself and, as we all know, “Bird-flu” is a far more serious condition.

I think I must have picked up this particular bug during my daily commute, which currently involves quite a lot of time on the Tube.

In order to pass the time in the morning crush that is the Northern Line, I’ve taken on a challenge from Simon.

He claims that, apart from St. John’s Wood, there is no other tube station that does not contain at least one letter from the word “Mackrel”.

Whilst this may seem a somewhat esoteric fact, it’s probably quite appropriate to look for bits of fish whilst wedged into a Tube train like a sardine.

The tube map itself includes station on the Overground Network as well as the DLR so, ironically, this does provide a bit of “wiggle-room” for my Mackrel search.

All of which serves to act as an example in the following exploration of how Oracle transactions work…
Continue reading

Oracle Schema Differences – keeping up with the Prefix Pixie

Saturday 11th September 1976. That was the day that my Dad first took me to see the (occasionally) mighty West Ham United.
The opponents, the rather more often mighty Arsenal.
I still have vivid memories of that game. The noise from the crowd. The fact that the grass looked so green, brighter than on the TV.
West Ham not playing very well. Frank Stapleton putting a bit of a downer on the day by having the temerity to score twice in a 2-0 win for the Gunners.
My Dad recently celebrated his 70th birthday.
His present from his first-born son ? A trip to see the (previously) mighty Luton Town take on the ( probably must have been from time to time) mighty Nuneaton Borough.
Now, this may seem poor reward for my dear old Dad – he takes me to see two of the top teams in the country and he gets the Blue Square Premier League in return.
Additionally, these days it’s less the colour of the grass that assaults the senses than the colour of the boots.
These are various flourescent colours, virtually none of them black.
Mind you, as Deb pointed out, if you play for Luton and spend most of your working life dressed in bright orange, then accessorising must be a bit of a challenge.
The game itself however, is another matter.
Typical English Football – very quick, lots of commitment. You can tell it’s not the Premiership by the absence of millionaires rolling around the floor in apparent agony because they’ve broken a finger-nail.
Two late goals sends the Hatters home happy.
All of which has nothing to do with the subject of this post, apart from my choice of examples.
Comparing the table structure between different schemas is standard functionality for any self-respecting IDE. However, things get a bit more tricky if you’ve had a visit from the Prefix Pixie. He, she (or it if you’re table relationship diagram dropped out of a design tool) thought it’d be a good idea to give the same prefix to every table in the schema.

The result of this is that the tools in the IDE can’t recognize that tables with different names are meant to have identical structures.
So much for the “Premiership” of Database Development, it looks like we’ll just have to do a bit of D.I.Y. to see through the poxie pixie dust.
Dad would approve. Continue reading

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.

All of which brings us to the INSERT statement. Continue reading

Oracle Batch Job Logging – a framework for domestic harmony

Like most men, I have a standard of tidiness and cleanliness that I think of as “Bloke Clean”.
Deb’s standards are rather higher ( she would say normal). The difference can occasionally be a source of tension.
“Maybe I’ll just run off with that Steven Feuerstein bloke !”, she may have said during one of our discussions about the state of the study.
“Oh really ?”, I might retort, “and what’s he got that I haven’t ?”,
“Money, fame, talent and his own framework…not to mention a cleaner, I’ll bet”.
“Well…at least I have more hair”, I might say, disconcerted by her surprisingly comprehensive knowledge of someone who, it must be said, is not exactly famous outside of the wonderful world of Oracle.
“Not by much.” would probably have been the devastating reply.
Predictably, a compromise has now been reached…the upshot of which is that I’ve just spent the afternoon becoming intoxicated by the fumes from various cleaning products…and the study is now gleaming and all the papers filed away…and we’re getting a cleaner.
As for the money, fame and talent…well, I’ll just have to make do with the framework for now.
Truth be told, calling it a framework is overstating things a bit. But hey, it does give me an excuse to come up with a (possibly) amusing name. Continue reading

Windows batch scripting and learning to love German footballers

Windows scripting – the computing equivalent of the German football team.
I suppose I should qualify that statement, if only to avoid irate comments from any German readers.
The German National side has always been admired rather than loved.

Yes, they have been more successful than most, and have produced more than their share of great players (Beckenbauer,
Rummenigge, Matthaus…add you’re own favourites here). Yet they are rarely cheered by the neutral.
This lack of popularity probably has quite a bit to do with the fact that, in major finals, Germany seem to be condemned to be cast as the bad guys against the forces of footballing light (the Total Football of Cruyff’s Netherlands in 1974), or the plucky underdog (Czechoslovakia in 1976, Denmark in 1992).

The footballing triumph regarded by Germans above all others is Das Wunder von Berne.
The 1954 World Cup Final was meant to be a coronation of one of the great teams in history. The Hungarians of Ferenc Puskas came into the final on the back of an unbeaten run going back 4 years, including an 8-3 thrashing of West Germany in the group stages of the tournament.

After eight minutes of the final, all was going to plan with Hungary already 2-0 up. What followed was one of the great comebacks – and great upsets – in the history of the game. Rahn completed the miracle with his second of the match, and the winner, with six minutes left.
Sepp Herberger, Fritz Walter and Helmut Rahn are the German equivalent of Alf Ramsey, Bobby Moore and Geoff Hurst. Outside of Germany, they remain largely unknown.
Incidentally, apologies for that 1966 reference, but unlike Germans (Italians, Spaniards…) we English have only that single triumph, or the odd glorious failure to look back on.

So, back to Windows batch scripting. It’s widely used, but next to the richness and variety of it’s siblings in the unix world, it appears hideously limited. However, there are times where it is simply unavoidable.

What follows are some basic examples of

  • Accepting user input
  • Using variables
  • a simple for loop ( because there is no other kind )
  • branching
  • interaction with an Oracle database

At this point, I have to say that if you are on a Unix/Linux system, or have access to Cygwin, there are far better ways of working with your database.

For any remaining poor unfortunates… Continue reading