- 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
Here's another one:
ORA-00942: table or view does not exist
Admin
That's not a leak, that's a closure.
Admin
As if the use joins to a function with nested cursors isn't bad enough, the cursors are dynamic and thus the contents can change on each fetch...this could explain why the execution time varied so much.
Admin
This thread has been pretty funny ... seeing all these debates about ways of writing different functions in procedural languages and how they can be made more efficient and so on is exactly why there are so many people writing crappy SQL code. They don't understand that there is huge different between optimizing SQL and optimizing procedural code, so they try to think about and optimize their SQL the way they would any other language. And thus, many WTFs are born ....
Admin
Shhh! You'll make them stop, and I need the laughs.
Admin
Don't worry, for every lamer being disabused, 10 new lamers are born.
Admin
Brilliant!....or "Brillant!"
It looks like the task/jobs of multi-tasking-threaded-enterprise application were stored in the Database...I've dealt with this before...but this is worse...it seems that the queueing algorithm used to move ID's from one table to another....
Notice the carrefull consideration on the transaction...5 ROWS at a Time...
So maybe another Thread could run a quick "SELECT count(*) FROM cojobs" and thus getting some progress-bar info...because, after all...it's The Report....
Now that it runs in 5 seconds..the GUI of the application seems to freeze (for short time)....hmmm...that reminds about the WTF with the scanner and the image processing technique a while ago...
Admin
Admin
D'oh! Yup, that's more or less what I mean. Actually, I was going to give
but using
map()
is much better :-)Admin
wtf?
Admin
I think the posted code is ugly because these UPPERCASE words everywhere, looks almost like a FORTRAN rippoff, only uglier. And looks unelegant because is not OOP oriented.
Theres also the problem is simply wrong code for the way SQL work. But maybe SQL itself lack ...something, so the unaware will avoid that holes.
Its posible to write elegant SQL code?
--Tei
Admin
I don't know, but I'm sure those programmer dudes weren't happy about being sacrificed.
:-)
Admin
There's also:
<font face="Courier New">(a, b) = (func(x), func(y))
(a, b)[b > a]
</font>
Admin
Utterly untrue as of PHP5. PHP4 has evil object-orientation. PHP5 has sensible, non-evil object-orientation where all variables holding objects actually hold references.
Admin
I generally assume that if I think I need to use a cursor, I've done something wrong, or I need to go read a book.
If I still think I need a cursor, I go ask someone with vastly more DB experience than I.
If I STILL think I need a cursor, I cross my fingers and write one :-)
Admin
Fortunately, they had a large IT staff on hand.
Admin
Yes. Absolutely. Unfortunately, not many do ..... it is so easy to learn and to get started that I think people assume after a day or so that they are experts in SQL and don't need to learn any more.
Admin
Show-off! ;-)
Admin
Except with something actually interesting going on.
Admin
gf = flip (min . func) . func
Admin
The Holy Hierophant of the Tabernacle of The Report has issued a fatwa against Steven, declaring him an infidel and excommunicating all data generated by the new, pretender "job aggregate summary report." Beware the Report Jihad!
Admin
Yep, I had to deal with such code previously, I remember one incident where a client complained about one of their reports that it’s taking almost an hour and then the connection breaks, so they have never got a chance to see any output, when I looked at the code it was written in T-SQL as stored proc an the structure of the code was using three levels cursors with some calls to UDFs, and that was the straw that broke the back of the camel, the code was more than 35 lines of code that became ~12 lines of code -although you can put all of them in one line- after I re-wrote it in one straight SQL and it runs in ~10 seconds.
Admin
Ever heard of python?
Admin
This