wildcards

  • Toreador (9/11/2013)


    Dear Steve

    Can you change the points system so that if someone replies pointing out an error and 8 pages of people have already replied pointing out the same error in the same way, then instead of giving them an extra point, they instead have 10 points subtracted?

    Thanks in advance

    Great idea.............!!!

    :-D:-D:-D:-D:-D:-D:smooooth:

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Toreador (9/11/2013)


    Dear Steve

    Can you change the points system so that if someone replies pointing out an error and 8 pages of people have already replied pointing out the same error in the same way, then instead of giving them an extra point, they instead have 10 points subtracted?

    That would perhaps encourage people to read the existing posts before posting something that's already been posted a bunch of times.

    Myself, I noted the varchar(10) declaration, parsed the code manually, and then ran it to confirm my initial finding. I was lucky enough to have had ANSI warnings set to OFF when I ran it. Can't say what I would have answered had that not been the case.

    Mostly I'm disappointed at the number of posts that read like "you're an idiot" when addressing an earlier poster. As this is September 11th, a day of some import to Americans, I'd like to hope that we all can find a way to communicate with less venom.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Your query statement in the current (09/11/13) newsletter indicates that the character string must be 10 characters long. So in this case, an error message would be raised because 'Steppenwolf' contains 11 characters. If it was 11 or more characters then the answer would have been 2. Thus I should not be penalized for losing that one point! πŸ˜‰

  • The correct answer is 0!

    In my time answering questions here as well as coding I have learned to look for 'tricks' in the question or code.

  • Richard Warr (9/11/2013)


    Come on guys, it's pretty obvious what the point of the question was and knocking the last letter off of 'Steppenwolf' makes everything work as the OP intended.

    I disagree on two major points.

    First, I have come to expect trick QotDs, especially in the T-SQL category. Be sure to count the number of characters is exactly the kind of thing I would expect to see in a right answer. So parsing it out exactly is necessary.

    Secondly, and more importantly, I am a computer professional. I work in a world of absolutes. Compilers do not give you credit for the code you intended to write. They execute what you did write, and if it is wrong you have to fix it (except in the extremely rare case of a Good Bug).

  • Toreador (9/11/2013)


    Dear Steve

    Can you change the points system so that if someone replies pointing out an error and 8 pages of people have already replied pointing out the same error in the same way, then instead of giving them an extra point, they instead have 10 points subtracted?

    Thanks in advance

    Do you mean 80 messages or 400 messages or something in between? A count of pages is meaningless, since people set their forum view to have various different numbers of message per page (currently you can pick any multiple of 10 between 10 and 50 inclusive).

    Tom

  • L' Eomot InversΓ© (9/11/2013)


    Do you mean 80 messages or 400 messages or something in between? A count of pages is meaningless, since people set their forum view to have various different numbers of message per page (currently you can pick any multiple of 10 between 10 and 50 inclusive).

    Yes, I almost certainly mean one of those πŸ˜‰

    2 more duplicates in the 14 minutes or so since I last posted...

    [Edit: correct number of minutes before the first pedant beats me to it]

  • My apologies for the error. the question was tested, but as I'm sure many of you have done, I made a change in production, altering the last name because I didn't like what was there.

    A few lessons here.

    1. regression test all changes

    2. don't fit your data types too tightly to the data. a varchar(50) or varchar(100) would have been a better choice and wouldn't alter the storage used.

    3. a little patience. Plenty of people pointed out the error. I don't award back points or change questions based on votes. I'll change it if it's incorrect.

    The question has been changed and points will be awarded back shortly.

  • Maybe someone already pointed this out:

    The question in the email defines @i as:

    DECLARE @i TABLE( mychar VARCHAR(10));

    The question provided on the page where you provide an answer defines @i as:

    DECLARE @i TABLE( mychar VARCHAR(50));

    Thus the source of the problem.

  • darkhelmutis (9/11/2013)


    Maybe someone already pointed this out:

    The question in the email defines @i as:

    DECLARE @i TABLE( mychar VARCHAR(10));

    The question provided on the page where you provide an answer defines @i as:

    DECLARE @i TABLE( mychar VARCHAR(50));

    Thus the source of the problem.

    Steve posted 2 minutes before you did saying the question has been corrected--that's why the answer page now says VARCHAR(50). It didn't before Steve corrected it!

  • +1 I also checked 0. Got an error when I ran it.

  • I must admit, up until I saw Steve's post about changing the question, I couldn't understand all the griping as I saw the column definition for mychar having a length of 20. Glad I was delayed two hours for today's QotD πŸ˜€

    I was also very glad that there were no non-printable characters between the e and p in at least one of the non-matching words πŸ˜€

  • I didn't read the question until after it was fixed. Having said that, good question. I have never used that is a like statement so I learned something new.

  • Thanks Steve!:-)

  • Secondly, and more importantly, I am a computer professional. I work in a world of absolutes. Compilers do not give you credit for the code you intended to write. They execute what you did write, and if it is wrong you have to fix it (except in the extremely rare case of a Good Bug).

    Me too. Have you never been given a spec and taken it back saying "I think you really mean this"? Although the relationship between coder and compiler may be absolute, that between coder and client is far from it.

    _____________________________________________________________________
    MCSA SQL Server 2012

Viewing 15 posts - 76 through 90 (of 145 total)

You must be logged in to reply to this topic. Login to reply