Today's Oracle gem of the day was not learned from an O'Reilly book, an online forum, or even an Oracle reference manual. No, I'm pleased (and also dismayed) to announce that today's Oracle gem was gained through the loudest, but not always best, teacher: experience.
Today's Oracle gem is this: when you SELECT into a PL/SQL record, order matters.
I was under the misguided impression that when you SELECTed into a record, Oracle dutifully matched up each column to the eponymous field of your record and populated it. Boy was I wrong! I'm working on the largest SQL statement I've ever seen in my life, and unfortunately I am just now testing after getting most of it written. I got some gripe about converting characters to numbers.
Odd, I thought. I cross-referenced the types of every field in the record and the statement, starting with the main table involved; everything matched. I stripped out all the fields from associated tables, commented out half the structure of my record, and tested. No problem. Then I uncommmented the first field and join condition. Immediately everything blew up. "Ah!" I thought, "It's not the types of the fields, it's something stupid I did in the join condition!" I commented the field back out and tested with the join condition but pulling no fields from that table. Everything worked, proving in fact that the problem was the single field I was pulling out of that table.
Turns out my record definition and my SELECT statement have all the fields in a completely different order. The orderings are logical in each case, but will not work together. Even when I got the statement to run on just the fields from one table, I probably had countless mismatches doing who knows what to my data. I'm just glad I found it now.
Remember, folks, test early and often! Preferably earlier than me...
Meanwhile, I'm considering bidding on this. The interesting part is the A/V cables. I'm actually planning on getting an original system and trying my hand at hacking it to produce composite video. Probably be fun, but I'd probably rather get one premade.
Re:atari fun
jdavidb on 2003-05-12T14:31:48
I have my eye on those, as well. I finally decided what I really wanted was to get back into gaming; I already have a 2600 and several games, though not all the ones in those 10-in-1 systems. I can play most of the ones I don't have through emulators, but there's still some I'd like to get ahold of.
There used to be a business called Hozer Video that would make you a cartridge of any Atari game ever made. I just found out last night they went out of business after personality conflicts. I'm extremely annoyed. There are likely now some games I'll never be able to play that I wanted to get through them. I love those old games; performance was impossible, so playability was the watchword.
As I said, I already own a 2600, but it is a priceless gift from my father when I was a boy, so I could never open it and take a soldering iron to it. I'm probably not too good at that kind of thing anyway, so the Brazilian model that already had A/V cables would have been nice, but end the end I decided to pass. I may be able to inherit an extra 2600 from my brother-in-law, though, I hear.
Meanwhile, I am most definitely going to acquire a 5200. I have longed for one of those machines for nearly twenty years. I've only seen one in my life, and I almost cried when that friend (who I didn't get to see more than once a year or so) told me he'd gotten rid of his and gotten a Nintendo.