User-Defined Types and Methods
With user-defined types, it is possible to create new data types that can be used in table definitions and stored procedures.The data type used in a user-defined type definition may be a predefined data type or another user-defined type.
It is possible to define methods for a user-defined type. Methods are very similar to functions, they have only in parameters and return a single value. There are three different types of methods, constructor, instance and static methods.
Constructor methods are used to create new instances of a user-defined type. An instance method can only be used with an instance of a user-defined type. A static method is similar to a function, the only difference is how they are invoked. Both instance and constructor methods have an implicit parameter named
SELFwhich represents an instance of a user-defined type.
It is possible to alter a user-defined type by adding or dropping methods.
An ident can use a user-defined type created by another ident, if the user has been granted usage privilege on the user-defined type. Likewise, in order to be able to use a method the user must have been granted execute privilege on the method.
Mimer Information Technology AB
Phone: +46 18 780 92 00