logo  
Google
 

DB2 SQL-Error: -458

SQLState: 42883

Short Description: IN A REFERENCE TO FUNCTION BY SIGNATURE A MATCHING FUNCTION COULD NOT BE FOUND

In a reference to function function-name by signature, no matching function could be found. The problem could be with the data type or some other attributes of a parameter. For some data types there are attributes in addition to data type: v Length, precision, or scale While it is not necessary to specify a length, precision, or scale attribute for a data type, if one is specified then there must be an exact match on the corresponding specification of the parameter for the existing function as defined in SYSPARMS. A type of FLOAT(n) does not need to match the defined value for n since 1<=n<=21 means REAL and 22<=n<=53 means DOUBLE. Matching occurs based on whether the type is REAL or DOUBLE. However, a match on data type is sufficient. To indicate this, an empty set of parentheses must be specified for the data types that allow a specification of length, precision, or scale. For example, assuming a function exists for which a parameter was defined as CHAR(12) on the CREATE FUNCTION statement, a reference to that function by a signature could specify this parameter as either CHAR(12), or CHAR(). The CHAR() syntax provides a way to say ?donÂ’t care about length, precision and scale attributes in finding a matching function?. FLOAT() cannot be used since the parameter value indicates different data types (REAL or DOUBLE). If, however, neither length, presision, scale, or empty parenthesis were specified, then normal default rules apply. For example, a specification of CHAR would result in CHAR(1) as on the CREATE TABLE statement. Furthermore, this implicit specification of length, precision, or scale must exactly match the corresponding specification of the parameter for the existing function as defined in SYSPARMS. v Subtype, or encoding scheme You do not need to specify the subtype or encoding scheme (CCSID clause) to identify an existing function in the database. However, if a subtype or encoding scheme is specified then there there must be an exact match on the corresponding specification of the parameter for the existing function as defined in SYSPARMS. Unqualified function names: v For ALTER FUNCTION, DROP FUNCTION, COMMENT ON FUNCTION, GRANT and REVOKE statements for EXECUTE on functions, an unqualified function name is implicitly qualified with the statement authorization ID, and this is the schema where the function with the problem can be found. v In the SOURCE clause of a CREATE FUNCTION statement, the qualification comes from the SQL path. In this case, the is no matching function in the entire path. Attention:A function cannot be sourced on the COALESCE, NULLIF, RAISE_ERROR, or VALUE built-in functions. Additionally, there are restrictions on the way that you can source on the COUNT, COUNT_BIG, CHAR, and STRIP built-in functions because of some of the keywords that they accept.System action: The statement cannot be executed. Programmer response: Possible responses include: v Changing the SQL path to include the correct schema. v Changing the attibutes of the parameters. v Using a SPECIFIC name to refer to the function instead of a signature.

 <-  BACK TO INDEX