<<Interface>> DB2Function {Analysis} derived from: DB2Routine

Documentation
SQL Reference for Cross-Platform Development - v1.1
http://www7b.software.ibm.com/dmdd/library/techarticle/0206sqlref/0206sqlref.html

Functions (Chapter 1. Concepts 9)

A function is a routine that can be invoked from within other SQL statements and returns a value, or a table. For more information, see "Functions" on page 93.

Functions (Chapter 2. Language elements 93)

A function is an operation denoted by a function name followed by zero or more operands that are enclosed in parentheses. It represents a relationship between a set of input values and a set of result values. The input values to a function are called arguments. For example, a function can be passed two input arguments that have date and time data types and return a value with a timestamp data type as the result.

Types of functions:
There are several ways to classify functions. One way to classify functions is as built-in, user-defined, or generated user-defined functions for distinct types.
- Built-in functions are functions that come with the database manager. These functions provide a single-value result. Built-in functions include operator functions such as ??+??, column functions such as AVG, and scalar functions such as SUBSTR. For a list of the built-in column and scalar functions and information on these functions, see Chapter 3, "Built-in functions", on page 131. The built-in functions are in a product-specific schema.
- User-defined functions are functions that are created using the CREATE FUNCTION statement and registered to the database manager in the catalog. For more information, see "CREATE FUNCTION" on page 325. These functions allow users to extend the function of the database manager by adding their own or third party vendor function definitions. A user-defined function is an SQL, external, or sourced function. An SQL function is defined to the database using only an SQL RETURN statement. An external function is defined to the database with a reference to an external program that is executed when the function is invoked. A sourced function is defined to the
database with a reference to a built-in function or another user-defined function. Sourced functions can be used to extend built-in column and scalar functions for use on distinct types. A user-defined function resides in the schema in which it was created.
- Generated user-defined functions for distinct types are functions that the database manager automatically generates when a distinct type is created using the CREATE DISTINCT TYPE statement. These functions support casting from the distinct type to the source type and from the source type to the distinct type. The ability to cast between the data types is important because a distinct type is compatible only with itself. The generated user-defined functions for distinct types reside in the same schema as the distinct type for which they were created. For more information about the functions that are generated for a distinct type, see "CREATE DISTINCT TYPE" on page 319.

Another way to classify functions is as column, scalar, or table functions, depending on the input data values and result values.
- A column function receives a set of values for each argument (such as the values of a column) and returns a single-value result for the set of input values. Column functions are sometimes called aggregating functions. Built-in functions and user-defined sourced functions can be column functions.
- A scalar function receives a single value for each argument and returns a single-value result. Built-in functions and user-defined functions can be scalar functions. Generated user-defined functions for distinct types are also scalar functions.
- A table function returns a table for the set of arguments it receives. Each argument is a single value. A table function can be referenced only in the FROM clause of a subselect. A table function can be defined as an external function, but a table function cannot be a sourced function. Table functions can be used to apply SQL language processing power to data that is not data that is not stored in the database or to allow access to such data
as if it were stored in a result table. For example, a table function can take a file and convert it to a table, get data from the Web and tabularize it, or access a Lotus Notes database and return information about email messages.


Parent PackageDB2ModelAbstractNo
Export ControlPublicAccessLink Class forNone
Class KindNormalClassCardinalityn
Space ConcurrencySequential
PersistenceNo  


Operations
NameSignatureClass
addEAnnotationEAnnotation addEAnnotation (String source)SQLObject
addEAnnotationDetailvoid addEAnnotationDetail (EAnnotation eAnnotation, String key, String value)SQLObject
getEAnnotationDetailString getEAnnotationDetail (EAnnotation eAnnotation, String key)SQLObject
setAnnotationDetailvoid setAnnotationDetail (EAnnotation eAnnotation, String key, String value)SQLObject
removeEAnnotationDetailvoid removeEAnnotationDetail (EAnnotation eAnnotation, String key)SQLObject
getEAnnotationEAnnotation getEAnnotation (String source)SQLObject
getEAnnotationEAnnotation getEAnnotation (String source)EModelElement
eClassEClass eClass ()EObject
eIsProxyboolean eIsProxy ()EObject
eResourceEResource eResource ()EObject
eContainerEObject eContainer ()EObject
eContainingFeatureEStructuralFeature eContainingFeature ()EObject
eContainmentFeatureEReference eContainmentFeature ()EObject
eContentsEEList eContents ()EObject
eAllContentsETreeIterator eAllContents ()EObject
eCrossReferencesEEList eCrossReferences ()EObject
eGetEJavaObject eGet (EStructuralFeature feature)EObject
eGetEJavaObject eGet (EStructuralFeature feature, boolean resolve)EObject
eSet eSet (EStructuralFeature feature, EJavaObject newValue)EObject
eIsSetboolean eIsSet (EStructuralFeature feature)EObject
eUnset eUnset (EStructuralFeature feature)EObject


Attributes
NameClassTypeInitial Value
finalCallDB2Functionboolean 
scratchPadDB2Functionboolean 
scratchPadLengthDB2Functionint 
functionTypeDB2FunctionString 
predicateDB2FunctionString 
externalActionDB2Functionboolean 
cardinalityDB2Functionint 
allowParallelDB2Functionboolean 
returnClauseDB2FunctionString 
originDB2FunctionOriginType 
inheritLockRequestDB2Functionboolean 
fencedDB2RoutineString 
threadsafeDB2RoutineString 
dbInfoDB2Routineboolean 
implicitSchemaDB2Routineboolean 
federatedDB2Routineboolean 
parmCcsidDB2RoutineString 
specialRegisterDB2RoutineString 
changeStateDB2Routineint0
debugIdDB2RoutineString 
programTypeDB2RoutineString 
origSchemaNameDB2RoutineString 
origParmSigDB2RoutineString 
specificNameRoutineString 
languageRoutineString 
parameterStyleRoutineString 
deterministicRoutineboolean 
sqlDataAccessRoutineDataAccess 
creationTSRoutineString 
lastAlteredTSRoutineString 
authorizationIDRoutineString 
securityRoutineString 
externalNameRoutineString 
descriptionSQLObjectString 
labelSQLObjectString 
nameENamedElementString 


Associations
NameMy RoleMy ClassOther RoleOther Element
--Not Named--localFunctionDB2Function--Not Named--LUWFunctionMapping
--Not Named----Not Named--DB2RoutineextendedOptionsDB2ExtendedOptions
--Not Named----Not Named--DB2RoutineroutineExtensionsDB2RoutineExtension
--Not Named--routineRoutineparametersParameter
--Not Named--routineRoutinesourceSource
--Not Named--routinesRoutineschemaSchema
--Not Named--orderingRoutineRoutine--Not Named--UserDefinedTypeOrdering
--Not Named----Not Named--SQLObjectcommentsComment
=--Not Named--SQLObjectdependenciesDependency
--Not Named--objectSQLObjectprivilegesPrivilege
--Not Named--actionObjectsSQLObject--Not Named--Privilege
--Not Named--eModelElementEModelElementeAnnotationsEAnnotation
--Not Named--contentsEObject--Not Named--EAnnotation
--Not Named--referencesEObject--Not Named--EAnnotation
--Not Named--targetEndEObject--Not Named--Dependency
--Not Named--accessPlansDB2AccessPlan--Not Named--DB2Schema


Generalization Relationships
NameClassSupplier
--Not Named--DB2FunctionDB2Routine
--Not Named--DB2RoutineRoutine
--Not Named--DB2RoutineDB2AccessPlan
--Not Named--RoutineSQLObject
--Not Named--SQLObjectENamedElement
--Not Named--ENamedElementEModelElement
--Not Named--EModelElementEObject
--Not Named--DB2AccessPlanSQLObject



Property Settings

Data Modeler
dmItemFalseDMName 
IsTableFalseIsViewFalse
IsDomainFalseIsSPPackageFalse
Synonymns TableSpaceID 
SourceId SourceType 
CorrelationName SelectClause 
IsUpdateableTrueCheckOptionNone
IsSnapShotFalseIsDistinctFalse
PersistToServer IsPackageFalse