Try OpenEdge Now
skip to main content
SQL Development
User Defined Functions : Semantics and Limitations
 

Semantics and Limitations

The following semantics and limitations are applicable while creating User Defined Functions:
*The body of a UDF is written in Java, and can be as small or as large as needed to accomplish the purpose of creating the UDF. The body of the function is simply normal Java and can easily reference the function’s parameters.
*The input parameters to the UDF can be any value that can be used in a query – a database column, a constant, an expression of other values, etc. SQL allows a UDF without input parameters, if that suffices for the UDF’s program logic.
*The output value of the UDF can be any SQL datatype, and is created by the Java code in the function body.
*A UDF inherits expression semantics.
*A UDF cannot call another UDF except by executing a SQL statement.
*A UDF cannot call stored procedures.
*A UDF cannot execute any DDL statements and do CRUD operations. However, executing a SELECT statement is allowed from a UDF. Select statements from UDF can also cause Authorized Schema Updates if it is turned on.
*Scalar UDF must return a single value of supported OpenEdge data types, except BLOB/CLOB and ARRAY.
*UDF input arguments can be Scalar Sub Queries.
*UDF names cannot be same as those of scalar functions or those of table names and procedure names in database.
*Dropping a UDF is an online operation.
*Altering a UDF is not supported. To alter a UDF, a user has to drop and recreate the UDF.