|
SQL Snippets: Tutorials for Oracle Developers |
Read Using SQL Snippets before using any of this site's code or techniques on your own systems. |
SnippetyJoe's BlogThe Choice2007-02-21
The Choice. It always comes down to The Choice, doesn't it? You know the one I'm talking about. It happens every day in our field. A decision is required and you have to choose between doing it quick and dirty or slow and clean. Quick and dirty gives you a cheap, short term gain with long term pain. Slow and clean is just the opposite. Quick and dirty is responsible for unstable and incomplete version 1 products, inadequate applications that get scrapped and re-built for more money than it would have cost to do it right the first time, or barely adequate applications that insinuate themselves into your business processes and slowly drain your company's productivity. Slow and clean gives you that shiny new app. that took three years to build and no one uses, or the infamous "Never-ending Project", or a massive investment in a custom system that gets shelved when a new VP decides to switch to a less suitable, off-the-shelf product from his former employer. The Choice pops up on smaller scales too. I recently had to make The Choice when it came to learning the MODEL clause of the SQL SELECT command. While working on the SQL Snippets section Delimited Strings I recognized that MODEL might provide a solution for string aggregation. Unfortunately I didn't know how MODEL worked. And that's when it happened ... (ominous music plays). The Choice reared its ugly head. Do I try to find some pre-existing MODEL examples and tweak them without really understanding how they work or do I spend an inordinate amount of time learning the entire feature properly just to create one SELECT statement? In the past, every time I considered learning the MODEL clause I would take one look at the spaghetti-bowl syntax diagrams, terse definitions, and cryptic descriptions of SQL modeling available and immediately lose interest. In the end I did what every effective programmer does. I cheated and changed the requirements. First I started down the long, slow, painful, clean road and tackled learning MODEL the right way, from first principles. I soon realized, however, that I could create new content for my site right away by writing tutorial pages for others who want to learn MODEL too. The result was a whole new SQL Snippets section for guiding future readers quickly through the same learning maze that took me weeks to navigate (SQL Features Tutorials: MODEL Clause) in addition to achieving the original goal of a new snippet for string aggregation (Rows to String: MODEL Method 3).
That's the theory at least. The real test comes down to you. If you've never used MODEL before or only had a quick and dirty introduction to it, please give the tutorials in the
SQL Features Tutorials: MODEL Clause
section a try and let me know how effective they were at helping you learn. You can email me at
|
Ads by NSC Cards
Ads by Joe
Pay it Forward
Did the free information on this site help you? Consider repaying the favour by helping others. Next time you see a discussion forum question or blog topic about something you've seen covered on SQL Snippets help out by replying with a link to the SQL Snippets topic. It's easy to do. Simply cut and paste code from the Linking to SQL Snippets section at the bottom of this page. |
||||||||||||||||||||||||