• oh_yeah (unregistered)

    superfluous fr1st..

  • Geo (unregistered)

    FIRST

  • fjf (unregistered) in reply to Geo
    Geo:
    FIRST
    Vestigial comment: It doesn't serve its original purpose (to comment on the article), but it has taken on a secondary purpose (to show that the poster is an idiot). Thanks for the demonstration.
  • (cs)

    TRWTF is that the second SQL statement is never executed.

  • (cs)

    I predict an explosion of comments concerning SQL injection and the merits of stored procedures vs. queries.

  • (cs) in reply to fjf
    fjf:
    Geo:
    FIRST
    Vestigial comment: It doesn't serve its original purpose (to comment on the article), but it has taken on a secondary purpose (to show that the poster is an idiot). Thanks for the demonstration.
    You win the internet today!
  • Bobby Tables (unregistered) in reply to frits
    frits:
    I predict an explosion of comments concerning SQL injection and the merits of stored procedures vs. queries.
    How long until the xkcd reference?
  • Jesse (unregistered) in reply to frits

    Why bother, the statement isn't being used any way ;).

    But indeed it would have been a lot better if the statement were parametrized and it could probably have been placed in a stored procedure, which would have made it a lot more readable at the same time.

  • RBoy (unregistered) in reply to Bobby Tables
    Bobby Tables:
    frits:
    I predict an explosion of comments concerning SQL injection and the merits of stored procedures vs. queries.
    How long until the xkcd reference?

    Well, it won't be me, I cannot get XKCD on my embedded system.

    Dignissim: The official cult of Dig.

  • getmeaguiness (unregistered)

    tut, tut, joins in the where clause!

  • (cs)

    As I've stated before, Visual Basic can die of gonorrhea and rot in hell.

  • Bryan The K (unregistered)

    The Real WTF is that someone is using Visual Basic, amiright?

    CAPTCHA: vindico - akwardness, a sensation you are about to fail.

  • iogy (unregistered) in reply to Bobby Tables
    Bobby Tables:
    frits:
    I predict an explosion of comments concerning SQL injection and the merits of stored procedures vs. queries.
    How long until the xkcd reference?
    One nanosecond after you posted.
  • Izhido (unregistered) in reply to getmeaguiness
    getmeaguiness:
    tut, tut, joins in the where clause!
    Don't be so quick to condemn us, mate. It was only recently when Oracle decided to jump into the SQL-92 wagon and let us write, like, you know, ACTUAL proper inner joins...
  • anon (unregistered)

    That's some wicked syntax highlighting.

    And by "wicked," I mean "evil."

  • NoAstronomer (unregistered) in reply to Smitty

    Right! Because you never see shit like that in Java or C++ or PHP or Python.

    /sarc

  • Anonymouse (unregistered)

    Dead code peppered with old code that is commented out? Poorly written queries? This is WTF worthy?

  • Shriike (unregistered) in reply to NoAstronomer
    NoAstronomer:
    <sarcasm> Right! Because you *never* see shit like that in Java or C++ or PHP or Python. </sarcasm>
    FTFY

    captcha conventio: an Italian convention.

  • Nibh (unregistered)

    Hey! This WTF reminds me of this really awesome xkcd:

    http://xkcd.com/327/

    Oh little bobby tables. Look at the trouble your name has caused!

  • Migala (unregistered) in reply to Izhido
    Izhido:
    getmeaguiness:
    tut, tut, joins in the where clause!
    Don't be so quick to condemn us, mate. It was only recently when Oracle decided to jump into the SQL-92 wagon and let us write, like, you know, ACTUAL proper inner joins...

    Oracle and SQL-92? Don't they need to support empty strings for that?

  • (cs) in reply to Nibh
    Nibh:
    Hey! This WTF reminds me of this really awesome xkcd:

    http://xkcd.com/327/

    Oh little bobby tables. Look at the trouble your name has caused!

    Really? I don't see how it relates at all. The article actually makes me think more of this Marmaduke:

    http://comics.com/marmaduke/2008-03-29

  • Gumby (unregistered)
    " AND pim.D_EFF < sysdate AND pim.D_INEFF > sysdate "

    Not a WTF. Obviously they're using some database that uses quantum values where dates can be both greater than AND less than the current date.

  • anon (unregistered) in reply to Gumby
    Gumby:
    " AND pim.D_EFF < sysdate AND pim.D_INEFF > sysdate "

    Not a WTF. Obviously they're using some database that uses quantum values where dates can be both greater than AND less than the current date.

    TRWTF is that you are somehow able to read and post here while being blind. pim.D_EFF and pim.D_INEFF are two different date fields.

  • (cs)
    " WHERE pim.N_LOCATION = " & psLoc & " "
    Hmmm..... So if psLoc is a string (I guess hungarian notation is at least good for picking apart incomplete WTFs), then are the single quotes part of the string itself? Is it a string that is assumed to contain a numeric value?
  • Crash (unregistered) in reply to Cad Delworth
    Cad Delworth:
    TRWTF is that the second SQL statement is never executed.
    And the "Captain Obvious" award goes to...

    captcha: damnum - latin for "DAAAAAMN!". See also: "DAAAYUUUM!"

  • (cs)

    So.... wtf is with that naming convention? I know the pseudo-Hungarian with "s" for string, "i" for integer, etc, but what's with the p and l? I see the "p" prefix fairly often in Classic ASP.... which is more often than I like to see Classic ASP due to the fact so many shit businesses here seem to think Classic ASP is a perfectly valid tool to use in 2010.

    Param and Local?

  • (cs) in reply to snoofle
    snoofle:
    You win the internet today!
    Second prize: the internet today AND tomorrow!
  • Frz (unregistered) in reply to Gumby
    Gumby:
    " AND pim.D_EFF < sysdate AND pim.D_INEFF > sysdate "

    Not a WTF. Obviously they're using some database that uses quantum values where dates can be both greater than AND less than the current date.

    You do realize those are EFF (Effective?) and INEFF (Ineffective?)

    Also TRWTF is of course not that the second query is not executed but the first one used to be only to determine the content of the second one (hence it's result set is closed afterwards) the second query is probably executed after this snippet. So the WTF is that there are two statements executed instead of one...

    Regarding SQL Injection: Yes prepared statements would have been much nicer here, however we don't know if the input data to these queries can be trusted or not so assuming good faith the data is perfectly fine.

  • Anonymous (unregistered)

    Er, sorry guys but if you read the article you will see that the tnsnames file wasn't on Lennart's workstation - it was on a network share but it got removed when he ran the uninstaller.

  • Gary (unregistered)

    Where's the appendicitis? Assuming there's no exception-handling around this (in VB, I mean, what are the odds?), I suppose a couple of bad parameters would yield a SQL syntax error but that's about the worst I can see happening. At least they close the recordset....

    This looks more like a coccyx than an appendix.

  • (cs) in reply to Lorne Kates
    Lorne Kates:
    Nibh:
    Hey! This WTF reminds me of this really awesome xkcd:

    http://xkcd.com/327/

    Oh little bobby tables. Look at the trouble your name has caused!

    Really? I don't see how it relates at all. The article actually makes me think more of this Marmaduke:

    http://comics.com/marmaduke/2008-03-29

    You mean it isn't funny?

  • (cs) in reply to Gary

    Appendicitis is in Appendix B, "List of Common Ailments".

  • (cs) in reply to Cad Delworth

    TRTRWTF is that neither query gets executed.... and that ADO will bomb on the rs.Close statement

  • usitas (unregistered) in reply to MeesterTurner
    MeesterTurner:
    TRTRWTF is that neither query gets executed.... and that ADO will bomb on the rs.Close statement

    You may have missed this line:

    Set rs = lconConnection.Execute(lsSQL)

  • mike (unregistered) in reply to Frz
    Frz:
    Regarding SQL Injection: Yes prepared statements would have been much nicer here, however we don't know if the input data to these queries can be trusted or not so assuming good faith the data is perfectly fine.

    ... perfectly fine until the code is copy-pasted into a new application where the data is untrusted.

  • The Bytemaster (unregistered)

    Ok, I guess it is time for me to finally write up and submit one of the best WTF moments in code... it too is vestigial code, but it does a lot of something yet accomplishes nothing.

    Kind of like this post.

  • Jan (unregistered)

    I guess my job is becoming a WTF - I see worse than this every day. Unfortunately my contract prevents me from posting it here.

  • Hatterson (unregistered) in reply to MeesterTurner
    MeesterTurner:
    TRTRWTF is that neither query gets executed.... and that ADO will bomb on the rs.Close statement

    I'm sorry...what?

    Set rs = lconConnection.Execute(lsSQL) 
  • Appendicitis (unregistered)

    Technically, the appendix also serves to soften the stool, much like this article could use.

    CAPTCHA: capio, cap'm

  • usitas (unregistered) in reply to Appendicitis
    Appendicitis:
    Technically, the appendix also serves to soften the stool, much like this article could use.

    CAPTCHA: capio, cap'm

    mmm...soft serve...

    That's it! I'm off to DQ!

  • mike (unregistered) in reply to Hatterson
    Hatterson:
    MeesterTurner:
    TRTRWTF is that neither query gets executed.... and that ADO will bomb on the rs.Close statement

    I'm sorry...what?

    Set rs = lconConnection.Execute(lsSQL) 

    Sure, but have you seen the underlying library?

    class SQLConnection {
       Set Execute (String sqlStatement) {
          // TODO:  ??? Do some sort of sql-y stuff here. - [email protected]
          return false;
       }
    };
    
  • (cs) in reply to Nibh
    Nibh:
    Hey! This WTF reminds me of this really awesome xkcd:

    http://xkcd.com/327/

    Oh little bobby tables. Look at the trouble your name has caused!

    Ya know, I've never understood this comic. Why does the mother call her son "Little Bobby Tables" when his middle name is clearly DROP TABLE?

    I mean, my mom does call me ContraCorner does she?

  • BottomCoder (unregistered)

    Mmmm, sodomy...

  • (cs) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    So.... wtf is with that naming convention? I know the pseudo-Hungarian with "s" for string, "i" for integer, etc, but what's with the p and l? I see the "p" prefix fairly often in Classic ASP.... which is more often than I like to see Classic ASP due to the fact so many shit businesses here seem to think Classic ASP is a perfectly valid tool to use in 2010.

    Param and Local?

    This is very common in Visual Basic. VB Coders almost always use "p" to mean "prefix."

  • Hatterson (unregistered) in reply to mike
    mike:
    Hatterson:
    MeesterTurner:
    TRTRWTF is that neither query gets executed.... and that ADO will bomb on the rs.Close statement

    I'm sorry...what?

    Set rs = lconConnection.Execute(lsSQL) 

    Sure, but have you seen the underlying library?

    class SQLConnection {
       Set Execute (String sqlStatement) {
          // TODO:  ??? Do some sort of sql-y stuff here. - [email protected]
          return false;
       }
    };
    

    Well played

  • ctw (unregistered)

    This isn't Worse Than Failure. This is, at most, as bad as failure. Maybe not even that bad.

  • [email protected] (unregistered) in reply to ContraCorners
    ContraCorners:
    This is very common in Visual Basic. VB Coders almost always use "p" to mean "prefix."

    I have seen it to mean property also:

    Dim p_VestigalOrgan As Organ

  • Hans (unregistered) in reply to ContraCorners
    ContraCorners:
    ObiWayneKenobi:
    So.... wtf is with that naming convention? I know the pseudo-Hungarian with "s" for string, "i" for integer, etc, but what's with the p and l? I see the "p" prefix fairly often in Classic ASP.... which is more often than I like to see Classic ASP due to the fact so many shit businesses here seem to think Classic ASP is a perfectly valid tool to use in 2010.

    Param and Local?

    This is very common in Visual Basic. VB Coders almost always use "p" to mean "prefix."

    This is the funniest thing I've read on this site in a long time ;-)

  • (cs) in reply to Smitty
    Smitty:
    As I've stated before, Visual Basic can die of gonorrhea and rot in hell.

    I agree, visual basic should be allowed to have unprotected sex of all kinds with as many loose women as possible.

  • tation (unregistered) in reply to Anonymous
    Anonymous:
    Er, sorry guys but if you read the article you will see that the tnsnames file wasn't on Lennart's workstation - it was on a network share but it got removed when he ran the uninstaller.

    When did embedded systems gain access to network shares?

Leave a comment on “A Vestigial Query”

Log In or post as a guest

Replying to comment #306915:

« Return to Article