declarations

  • Raghavendra Mudugal (8/19/2014)


    TomThomson (8/19/2014)


    The pro is of course that if you put all the declarations combined with assignment in a non-repeated part of the stored procedure, trigger, or batch the assignments get executed exactly once, so the net effect is much the same as declaration with initialisation to a chosen value and this can quite useful for making the code easier to read (it reduces clutter).

    Thank you, Tom. When I came to know the in-line assignment types, I said, great as I did in VB.NET, now I can do in SQL too, probably, in future versions there will also be an option to mention ByVal or ByRef (like stuff) in procedure/function level....and slowing sql scripting will be taken over by OOPS concepts.

    It would be something of a catastrophe if SQL adopted OOPS concepts - it would stand a serious risk of degenerating into an appallingly awful mess like C++, wrecking the concept of data abstraction, and making set-oriented queries impossible to write (requiring RBAR iterators). Of course if competent academics made an OOPS-ified version of SQL it might not suffer those catastrophes, but competent academics wouldn't get a lookin because ANSI and ISO are effectively dominated by players from the IT industry.

    Tom

  • Nice and easy. Thanks for sharing

  • Nice one, thanks for question

    Thanks

  • Ack! I calculated the right answer but picked the wrong answer by mistake when I submitted the form. Great question, though.

    Thanks,

    webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

Viewing 4 posts - 16 through 18 (of 18 total)

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