IBM Books

Image, Audio, and Video Extenders Administration and Programming

UDF and UDT names

The full name of a DB2 function is schema-name.function-name, where schema-name is an identifier that provides a logical grouping for SQL objects. The schema name for DB2 extender UDFs is MMDBSYS. The MMDBSYS schema name is also the qualifier for the DB2 extender UDTs.

You can use the full name anywhere you refer to a UDF or a UDT. For example, MMDBSYS.CONTENT identifies a UDF whose schema name is MMDBSYS and whose function name is CONTENT. MMDBSYS.DB2IMAGE identifies a UDT whose schema is MMDBSYS and whose distinct-type name is DB2IMAGE. You can also omit the schema name when you refer to a UDF or UDT; in this case, DB2 uses the function path to determine the function or distinct data type that you want.

Function path

The function path is an ordered list of schema names. DB2 uses the order of schema names in the list to resolve references to functions and distinct data types. You can specify the function path by specifying the SQL statement SET CURRENT FUNCTION PATH. This sets the function path in the CURRENT FUNCTION PATH special register.

For the DB2 extenders, it is a good idea to add the mmdbsys schema to the function path. This allows you to enter DB2 extender UDF and UDT names without having to prefix them with mmdbsys. The following is an example of adding the mmdbsys schema to the function path:

SET CURRENT FUNCTION PATH = mmdbsys, CURRENT FUNCTION PATH

Do not add mmdbsys as the first schema in the function path if you log on as mmdbsys: If you log on with the mmdbsys user ID, the first schema in your function path is set to mmdbsys. If you then try to set the first schema in the function path to mmdbsys with a SET CURRENT FUNCTION PATH statement, your function path will begin with two mmdbsys schemas--an error condition.

Overloaded function names

Function names can be overloaded. This means that multiple UDFs, even in the same schema, can have the same name. However, two functions cannot have the same signature. A signature is the qualified function name concatenated with the defined data types of all the function parameters.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]