Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T-SQL User defined function overloading?

I understand that T-SQL is not object oriented. I need to write a set of functions that mimics method overloading in C#.

Is function overloading supported in T-SQL in any way? If there is a hack to do this, is it recommended?

like image 309
Nick Avatar asked Jun 26 '09 19:06

Nick


People also ask

What is function overloading in SQL?

But the functions must be accessible within an SQL statement. Some databases, such as DB2 and Informix, support function overloading. Overloading means that two or more functions with the same name can exist. Overloaded functions are differentiated by the number and types of parameters that each function takes.

How do you define a function overloading?

Function overloading is a feature of object-oriented programming where two or more functions can have the same name but different parameters. When a function name is overloaded with different jobs it is called Function Overloading.

What are the restrictions on overloaded function?

Restrictions on overloadingAny two functions in a set of overloaded functions must have different argument lists. Overloading functions that have argument lists of the same types, based on return type alone, is an error.

What is function overloading explain with example?

Function overloading is a C++ programming feature that allows us to have more than one function having same name but different parameter list, when I say parameter list, it means the data type and sequence of the parameters, for example the parameters list of a function myfuncn(int a, float b) is (int, float) which is ...


1 Answers

No, there is no way to do this.

I recommend you revisit the requirement, as "make apples look like oranges" is often difficult to do, and of questionable value.

like image 103
John Saunders Avatar answered Oct 04 '22 00:10

John Saunders