I have to admit that I've never taken a serious look at Oracle PL/SQL, despite working with Oracle at both the "large corporate" employers I've worked at.
Instinctively, I found the idea of a custom proprietary mini-language repulsive.
Skills in humans have about the same economic value as software in companies, unless they are being used they have practically zero tangible value.
But at my current work, I've been forced to adapt to the scenario where the database schema is too big to be reproduced from scratch, and there's too much code talking to the database to be able to reliable understand it all and safely make deep modifications to functionality purely at a Perl/application level.
The result is a compelling need to push functionality into the database, in particular declarative/Aspect type functionality of the "Whenever a row is inserted here, update this value over there" variety.
So the time has come that it's now necessary to sit down and learn Oracle PL/SQL.
Although PL/SQL is most certainly good for the resume, I was quite depressed about this situation, because I really don't want to learn some stupid proprietary language.
HOWEVER, all this changed for me when I read the first paragraph of the introduction in the O'Reilly Oracle PL/SQL book.
"Oracle PL/SQL is a high level language derived from Ada..."
Wait a second, what's this?
Ada as in designed-by-military-specification, best-language-for-life-critical-systems, used-in-nuclear-weapons Ada?
How is it that I've managed to go 10 years in the IT industry and NOT find this out...
Because this makes things FAR more interesting.
All of a sudden there's a much better chance that.
1. Oracle PL/SQL won't suck at a fundamental level, just have an ugly syntax.
2. Some of these skills might actually be recoverable in other situations.
Indeed, it appears that in the past Oracle actually did fork Ada as the starting point for their embedded language (although it's since diverged a bit more and they don't use a real Ada compiler internally)
And just as interesting, it appears that VHDL (the language used to design hardware) is also Ada-derived.
And since my primary driver for learning new languages is that they can do something that no other language I know can handle, this makes Oracle PL/SQL even more interesting, as a useful starting point into a family of languages that ALL can do things that none of my current languages support well.
Re:Postgres
Alias on 2008-01-09T09:27:26
I'm quite sure it's better integrated into the server.
Personally, if I'm going to be writing code inside the server, I want it as integrated as possible.
I'm a reluctant lover of PL/SQL. I have an orange O'Reilly Oracle shelf sitting in front of me that's about two and a half feet wide. At one time, I'd read about a third of these all the way through and had plans to finish the rest, but then I needed less Oracle, and now in my new job I currently don't need it at all. (But with this prominent shelf, when we do need Oracle, they'll know which employee to go to.
I felt a deep, visceral agreement when you said "Instinctively, I found the idea of a custom proprietary mini-language repulsive." That's how I looked at PL/SQL at first. It's mainly a bad idea. But in this case it just so happens it works out well. PL/SQL is integrated into the database in a way that is actually very pleasant and useful. Sometimes I can't imagine it being any different, because even though I can imagine improvements, I'm not sure anything else would be so well integrated.
As someone else said, PostgreSQL has something that looks a lot like PL/SQL, and I think that might be a better place to compare and see how well the languages are integrated. It's kind of like comparing the way Perl includes regular expressions with the way other languages try to include it as a library. Yes, you can run Java inside your Oracle database, or TCL inside your PostgreSQL database. But I think the database functionality is always going to feel "bolted on" to those languages in a way that will never happen in PL/SQL.
PL/SQL is a language worth learning. You may never rant and rave about it as much as Stephen Feuerstein (who's branched out recently and written the first book about MySQL stored procedures, I noticed), but that's only because you know that when he brags about how pretty PL/SQL is it's because he doesn't know how to compare it properly to Perl. But you will see some really good design decisions.
Re:I like PL/SQL
Alias on 2008-01-09T14:52:53
My original database experience order was MySQL -> Oracle -> Postgres.
Once I discovered Oracle, I realised how dodgy MySQL truly was, and Postgres for me has always been a less corporatey, less thorough, but slightly more sane version of Oracle.
I do like that you can relatively cleanly mix SQL syntax with the Ada-like coding in Oracle PL/SQL. The parsing implications (how complex their parser must be to deal with it) are amazing.
I see where Microsoft copied their idea from for doing the same in C#.
Once I get a bit more familiar with Oracle PL/SQL, I do plan to looking in more detail at how Postgres has taken the idea and run with it.