- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Okay, a little preemptive response to my criticism of nested tables. They are wholly unrelational and have as much place in a RDBMS as a hacksaw in a McDonald's Happy Meal.
They are a complete maintenance nightmare. Don't believe me? Ask the DBA to make a change to your Nested Table column in your table of 1M records. Expect hysteric laughter and an update period measured in hours.
They are completely unnecessary. Just as easy can a real table created, along with a relationship and appropriate FK constraints.
They are useless for anything but retreival. The structure inside of a nested table is represented like tblCalendar on steroids(http://thedailywtf.com/archive/2004/06/11/262.aspx). Seriously. Want to find if an order was shipped to a previous address (as the example uses), just page through the paper invoices ... it will be faster and wont bring your DB down for the week.
I consider this monstrosity a worse insult to computer science than Variable Variables ;-). But, just as VV have they're rare appropriate uses, Nested Tables do as well ... such as if you're shooting for an Object-Oriented Schema.
But let's be realistic ... when it comes down to the real world, developers use them to avoid creating a new relation. Just as the linked example demonstrated.
Admin
I feel so ashamed to admit that I have, indeed, done something similar. No, not an infinite loop, but I have (once) generated a random char in a loop till I reach desired_length.
I still feel traumatized about that. I need therapy.
Admin
Err.. generate random_char, concatenate, repeat till desired_length is reached, I meant.
Admin
Nested tables.. whoa :D. Looks like the constructs you could/can do in teh uniVerse database! (now property of IBM)
Almost as stupid: table aliasses in DB2: alias of table alias, of table alias of table alias of table alias....
who cooks these features up?
Admin
radom reader: What's wrong with generating random characters until you have desired_length of them? Sounds like a fairly decent way to generate an arbitrarily large random string if you have a need for one and your dev. environment doesn't provide built-in support. If life gives you lemons...
Admin
The most frightening thing about the nested tables issue is the guy who wrote the article Alex linked. Would you buy a used algorithm from this man?
http://www.praetoriate.com/images/don_burleson.jpg
Yeah, me neither. If Stereolab joined the Nazi Party, they'd put that guy on an album cover.
Admin
I thought the same thing when I saw his picture. One look and I said, "Would you trust this man?" My response, "Nope." He just looks like a scam, and certainly far from a DBA of any kind. Keep in mind, however, that the previous Q&A that I wrote was with myself while no one else was in the room....
Admin
Sweet, another case of RTFM.
Admin
hee hee! that Oracle guy website is hilarious. pushing nested tables: "...and thats all there is to it." Then right after that is his support hotline number ("requires $500 credit card retainer").
Admin
You gotta love this on his site as well - another WTF:
The solution to this problem is to enhance the standard SQLPlus prompt of “SQL>” to include the database name.
...
Note that this prompt is set at entry to SQLPlus and it will not change if you connect to another database using the SQLPlus connect statement. The following example clarifies this limitation of the SQLPlus prompt.
set ORACLE_SD=PROD;
export ORACLE_SID
sqlplus system/manager
PROD> select name from v$database;
PROD
1 Row selected.
PROD> connect system/manager@TEST
Connected.
PROD> select name from v$database;
TEST
1 Row selected.
-----
Now that helps!
Admin
I'm sorry, but anytime I look at any Oracle code, I say "WTF" out loud.
Admin
@Jeff S
and still PL/SQL is far superior to Transact-SQL
@Alex Papadimoulis
Although I never had the necessity to implement a nested table in Oracle I can’t agree that they compare to PHP’ variable variables, Yes they don’t fit to much in a relational database but Oracle is getting more and more OODBMS features, is that a bad thing? maybe but never the less OODBMS have a place and a purpose. I think a better comparison of nested tables would be against inner classes in OO languages. But anyway is just my opinion as is just your opinion.
Regarding the posted code:
All that I can say is that although the following code will be a lot faster than the while:
out_num_rand := dbms_random.value(10000000, 99999999)
The posted implementation would produce a more random value IMHO :-)
Admin
PL/SQL is a more powerful language, no doubt. All I'm gonna say is ... TOOLS! Seriously, version 10 .. and they can't come up with anything better than a command prompt?
Admin
I once converted a VB5 Access app to VB6 SQL Server, and discovered some code one day (I'll post it when I find it) where in order to generate a serial number for a deal the code worked as follows:
start with a three digit string, "000".
try and insert with that as a pk. If there is a duplicate key error, increment the number and repeat until the insert works.
The way of incrementing the string is beyon belief, but that's a whole other WTF.
Admin
You don't need no steeenkin' tools with PL/SQL. :-) You can always get TOAD (and incurr the wrath of your DBA forever) if you really can't handle typing ;->
Nested tables: They are the DEVILS invention, boy.
Mr. Burleson: Scary.
Admin
Am I the only one to have noticed that apart from giving dubious advice, this M. Burleson also happens to have established what is possibly the most intrusive dress code ever :
http://www.dba-oracle.com/dress_code.htm ?
We're still debating around here whether it's all a joke.
Admin
"http://www.dba-oracle.com/dress_code.htm ?
We're still debating around here whether it's all a joke. "
If women stopped wearing skirts, society would CRUMBLE!
Actually, it would be worth joining his company. Really. Just to be there the day he sends a female coworker home to shave her face.
Admin
LOL on the face-shaving comment!!
Even better, you should see what kind of rates they get!
http://www.dba-oracle.com/consulting_prices.htm
Admin
Hah
The following Oracle consulting rates are for personal consulting by Donald Burleson.
With more than two decades of Oracle consulting experience, Mr. Burleson is far more productive than ordinary Oracle consultants, and Burleson Consulting is one of the few Oracle consulting corporations to openly publish our Oracle consulting prices
Per Diem $500 / hour
Little ego stroke, eh? :)
Admin
My company has decided that the dress code page was made in jest. How can someone in one sentence say that you must wear a white shirt to look professional, and then go and have mustaches drawn on women in MS Paint and naked dudes on their website?
I mean, how much more unprofessional can you get than having a picture of Nick Nolte's Mug Shot?
Admin
seriously, the pl/sql compiler should be able to optimize that so easily
Admin
I agree the the dress code must be a joke, he actually says 'no female consultants should smell like cheap whores'
Admin
I'm not sure if it's "Kidding On The Square" or unprofessionalism. Looking at the rest of the site, I'm inclined to think the latter. They may dress spiffy, but the site really doesn't convey it ...
Admin
@Frans & Alex
Nested tables, or multi-valued attributes, to give them their MVDBMS name, are a useful construct if used in the correct way.
Firstly, a MVDBMS uses delimiters between values, fields and records, not fixed length records. Consequently adding a field is a simple exercise - there is no constraint on the length of an individual record because of the use of delimiters, and no rebuild is required.
Multi-valued fields work best when the data being recorded could be made up of a number of parts, such as an address (as a very simple example), or the parts on an order, lines on an invoice, etc.
There are a number of MVDBMS, D3 from Pick Systems/Raining Data, jBase, uniVerse & unidata from IBM/Informix/VMark, to name just 4.
I work with them day in, day out, so you would expect me to be biased :)
Admin
2. I require men and women to present a professional appearance while on client sites. Clean clothing and being clean-shorn is a primary requirement of working in my professional office. Additionally, it presents the client with the idea that we know what we are talking about.
3. I am an expert in Oracle consulting. Do not question over 20 years of experience by 1st year college graduates (as most of you obviously are)
I hope this clears up some confusion.
Don
Admin
"Do not question over 20 years of experience by 1st year college graduates"
Do you realize it sounds like you have 20 first-year grad students doing all your work? If working for you is each student's part time job it might explain the WTF code posted at the top.
I looked at your site. I'd never hire you. I agree in presenting a professional image during business engagments. I don't agree with coming across as a slob even in one's personal time. I tend to relate the two when I judge a person.
Also with remarks like "I've also taken to working naked, and I find this very freeing, allowing me to express my inner Redneck. It's also ensures that people knock before entering my office." I wonder who is a hippy. It is interesting you also say "Consultants who are sloppy in appearance and manners will not be tolerated".
PS: This reply may not be the best place for such discussion but it would be nice if a Google search for "Donald Burleson" found this thread.
Admin
One does have to wonder... if the above post claiming to be from Donald Burleson is really from him.
If so, I love how he contradicts himself, demanding professionalism from his underlings in the office... and yet acting in such an unprofessional manor on this site and even on his own.
Given his dress code... one wonders if such a policy could be upheld in court if one of his female staffers were to go to court claiming sexual harassment for the artificially imposed limit on what she can wear to work. It’s one thing to say that a person must dress in a professional manor, but it’s quite another to declare what that is down in a way that could seem to be sexually gratifying for the policy maker (ie “mmm, legs”).
By the way, Don? Regarding your 1st point...Where I come from, ‘unprofressional’ is spelled ‘unprofessional’ and ‘dont’ is properly spelled ‘don’t’.
I hope this clears up some confusion.
Brendan
Admin
"Dirty, unprofressional hippies go nowhere in life. "
Yeah, who wants to be like that fucking Bill Gates loser.
Admin
I hope this clears up some confusion. Don
Yep, now I -know- you're an idiot :-)
Admin
"If you have been working all-night and have an early morning meeting, you can use an anti-inflammatory hemorrhoid cream (e.g. Preparation H) to quickly shrink those unsightly puffy bags under your eyes."
Admin
Alex,you may want to remove the spam comments.