Quote:
|
Originally Posted by db2farmer
the definition for a UDF of the type Scalar or Table is nearly identical to the definition of an External Stored Procedure.
|
They differ in the way they can be used (called).
A scalar UDF can be called as any scalar built-in function, i.e., inside SQL statements where an expression is expected.
A scalar UDF takes any number of arguments of any type, but must return a single scalar.
A stored procedure can only be called by using the CALL statement.
It does not return a value -- instead, some of its arguments (again scalars of "any" datatype) will be declared as "output" and will be able to return data to the caller.
There is more to it than this, but consider this "the basics".