On scalar valued user defined functions

From: Alex Szalay <szalay-at-jhu.edu>
Date: Sun, 21 Oct 2007 06:42:02 -0400


Here is short blurb on scalar valued user defined functions. It would be good if this could be incorporated into our grammar

--Alex



Invoking User-defined Functions That Return a Scalar Value

One can invoke a user-defined function that returns a scalar value anywhere that a scalar expression of the same data type is allowed in SQL statements:

Queries

User-defined functions that return scalar values are allowed in these locations:
. As an expression in the select_list of a SELECT statement
. As an expression or string_expression in a WHERE or HAVING clause
predicate
. As a group_by_expression in a GROUP BY clause
. As an order_by_expression in an ORDER BY clause.

Assignment Operators

Assignment operators (left_operand = right_operand) can invoke user-defined functions that return a scalar value in the expression specified as the right
operand. Received on 2007-10-21Z12:42:18