• Vera (unregistered)

    The only thing this is faster at, is in filling a screen with one query.

  • Darren (unregistered)

    It's a faster way to get your Lines of Code (LOC) metric up.

  • Hanzito (unregistered)

    If Ted had just enough knowledge to be dangerous, given the outcome, I'm wondering what that knowledge is, and what its source is.

  • xorium (unregistered)

    If column "updater" is not unique, Ted's code will update much more than only the row with change = @change.

  • Jason Stringify (unregistered)

    let's say you had a table called tbl_updater

    In that case, your first task is to stop using silly prefixes.

  • (author) in reply to xorium

    Given the naming conventions, I'm going to be generous and assume that updater is the primary key of tbl_updater. Our submitter didn't have anything to say on the subject beyond, "This is what the query should be," so it's a good assumption.

  • (nodebb)

    Apparently Ted thinks it's faster to set the "date" column twice. Kudos for creativity!

  • (nodebb)

    I don't say this often, but too bad they weren't using MySQL. It has a quirk where it doesn't allow using a subquery that references the same table in the WHERE clause of an UPDATE or DELETE query.

  • (nodebb) in reply to xorium

    If column "updater" is not unique, Ted's code will update much more than only the row with change = @change.

    I was going to say this. But the more I looked at this code, the more I believe there's a good possibility that updater is null.

  • Komodo Dragon (unregistered)

    Maybe Ted learned that from some Atari shareware database package back in the day.

  • (nodebb)

    Oh, it's faster alright. In the future, anyone who looks at the code will instantly understand Ted's "value" to the project. Much time saved.

Leave a comment on “Just a Few Updates”

Log In or post as a guest

Replying to comment #:

« Return to Article