I've got a few one-off data fixes to do. I have to do them all in RPG: though the client has SQL, they don't really know how to use it, so they don't want me using it. Also, they consider it dangerous.
Don't know SQL? Don't know SQL! SQL has to be the single most ubiquitously useful and transferable skill in IT. If you don't know SQL, and know it well, learn it now.
I can't recommend any introductory books on SQL, but I can recommend Joe Celko’s SQL for Smarties. At an advanced level, it's the only SQL book you'll need. (Platform specific stuff, you say? Don't use it.)
Dangerous? Well, yes, it's dangerous. You can indeed hose a lot of data very quickly with SQL. But then, screwing up a database with a compiler takes only a little longer. Both approaches are as safe as one another; test thoroughly, and you'll be fine. And doing the data fix right is usually quicker with SQL, too.
One piece of advice, though; no matter how sure you are that your SQL statement is right, test your query one more time over tha actual data that you are going to update before running the update.
Once upon a time, in the dim and distant past, I had a big live data update to perform. So, on the test system, I constructed test data, ran and printed a bunch of queries, wrote my SQL statement, re-ran my queries to show that the update has worked properly, cut-n-paste my SQL statement into a Word document, printed that, and dumped the whole lot onto my bosses desk to check. He gave the go-ahead, so I opened up a session on the live box, set (and double checked) my library list, cut-n-paste my SQL statement from the Word document into the live session, hit enter, and went for a cup of tea.
It was only when I got back to my desk that I realised that the last cut-n-paste had left all the 'not' symbols ('¬'s) behind. Thank God for journals. The system was down for several hours, though. Sigh.
Random SQL links: Pronunciation of SQL, and Ten Things I Hate About You.
Posted to iSeries by Simon Brunning at May 05, 2004 02:35 PMOoh, ooh, not quite basic SQL but don't forget;
http://datamodel.org/NormalizationRules.html
As for SQL being dangerous, these people are using AS/400s so they are a little simple in the head ;-)
Posted by: Andy Todd on May 5, 2004 05:09 PMHeh. I've met a lot of C++ and Java developers that despise SQL, but it didn't occur to me that any other group would be so set in their ways.
Posted by: Alan Green on May 5, 2004 10:52 PMTo be fair, SQL isn't really part of '400 culture. The '400 (or rather, its predecessors) had an RDBMS before they were *called* relational, even before Codd's laws were known outside IBM. Certainly, the '400 didn't have SQL for a *long* time.
Then, when it did, the first few releases of SQL on the '400 were *dog* slow - pretty much unusable. So, everyone kept up with native database access methods.
(SQL on the '400 goes like shit off a shovel now, though. It's got specialised database access hardware right there on the hard disks, so it leaves just about every other platform in the dust when it comes to DB access.)
So, I can forgive a '400 head not knowing SQL yet. Just about. But - it's time to learn.
Posted by: Simon Brunning on May 7, 2004 09:16 AMSimon,
I cant believe people are still scared of stuff on the '400. I hate that, 'we havent used it before, so were scared of it' attitude, that exists on the 400.
I can remember using SQL on the AS400 in 1990, and it was very useful, so I used it ever since. Cant believe that 14 years later that there are companies talking about it as if it is new technology. Most of the enhancements to the database are hitting the SQL side of things, so these people are just plain missing out. If they dont know about SQL, they probably are too scared to use triggers, constraints, referential integrity, User defined functions, stored procedures, UDTs, etc etc.
Some of this comes from management, but managements decisions are usually based on speaking to an established senior developer in the team, to assess whether a particular technology is viable.
If that developer has been to lazy to update their skills, and is still doing bog-standard RPGIII style development that they learned on the System 38.
Any as400 developer today who does not know any ony the following should be either sacked or horsewhipped within an inch of their lives:
RPGIV (available for at least 8 years)
SQL (15 years?, this should be on every as400 developers CV. SQL is only dangerous if you dont follow standard development practices. And once you've screwed up doing a mass SQL update or delete, you soon learn how to be careful! In our office what we do is keep a copy of 'SQL for dummies' lying around, and anytime anyone screws up with SQL, we put that on their desk. They soon learn not to use SQL for live, instead write proper fix programs, and take them through the full development cycle)
Free format RPG (3 years?)
Java (This one get right on my t***, cant believe that I have to try and convince people to learn java, im sure IBM announced this as key the future developments back in 1997)
Web app development (Considering how pervasive this stuff is now, I cant belive that there are developers out there that dont know how this stuff works yet)
Seriously, I believe that 400 developers that dont know this stuff are holding their teams back, and quite frankly they are making their jobs very boring too. My 2p!
Posted by: Colin Williams on May 9, 2004 01:01 PM