Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

jdavidb
  (email not shown publicly)
http://voiceofjohn.blogspot.com/

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Friday May 09, 2003
11:16 AM

EDOESNOTDWIM

[ #12097 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I recently purchased a Atari 10-in-1 [thinkgeek.com] thingy and it's about the most fun you can have with $22.99. Owning an original would be pretty cool though.
    • 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 a

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers