Implicit function overloading

  • Comments posted to this topic are about the item Implicit function overloading

  • Nice, easy question, thanks Erikur

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Hi Eirikur. Regarding this statement: "Functions overloading is not transparent in the SQL Server's implementations and can cause some confusion." (emphasis mine), did you mean to say that it is not transparent, or that it is transparent? I think it should be "is".

    Also, regarding the statement of: "The rule of thumb, which is not found in the BOL, is that the input data type directs the overloading", it does state in BOL, including in the documentation for REPLICATE that you linked to in the answer, which states:

    Return Types
    Returns the same type as string_expression.

    Similar wording can be found in the documentation for:

    • SUBSTRING
    • TRANSLATE
    • REPLACE (this one even has the same note about truncation to 8000 bytes occurring when not passing in a MAX type)
    Overloading is also used sometimes via number of parameters. Several functions have optional parameters, such as:

    For a related discussion, please see the following thread: Creating Strings with Replicate

    Take care, Solomon..

    SQL#https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
    Sql Quantum Lifthttps://SqlQuantumLift.com/ ( company )
    Sql Quantum Leaphttps://SqlQuantumLeap.com/ ( blog )
    Info sitesCollations     •     Module Signing     •     SQLCLR

  • Nice simple question
    Ta

    ---------------------------------------------------------------------------------------
    The more you know, the more you know that you dont know

  • Solomon Rutzky - Wednesday, September 26, 2018 11:25 PM

    Hi Eirikur. Regarding this statement: "Functions overloading is not transparent in the SQL Server's implementations and can cause some confusion." (emphasis mine), did you mean to say that it is not transparent, or that it is transparent? I think it should be "is".

    Also, regarding the statement of: "The rule of thumb, which is not found in the BOL, is that the input data type directs the overloading", it does state in BOL, including in the documentation for REPLICATE that you linked to in the answer, which states:

    Return Types
    Returns the same type as string_expression.

    • SUBSTRING
    • TRANSLATE
    • REPLACE (this one even has the same note about truncation to 8000 bytes occurring when not passing in a MAX type)

    For a related discussion, please see the following thread: Creating Strings with Replicate

    Take care, Solomon..

    You are right Solomon, I meant to say that it is transparent.
    😎

  • Very smart. Thank you, Eirikur!

Viewing 6 posts - 1 through 5 (of 5 total)

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