Hitachi

Hitachi Advanced Database Messages


KFAA30425-E

An invalid data type was specified in scalar function. (argument number = aa....aa, function name = "bb....bb", query number = cc....cc) (M+J+O)

The argument aa....aa of scalar function bb....bb contains an error. <SQLSTATE: 42782>

aa....aa: Number of the argument that contains the error

For example, if bb....bb is SUBSTR and 2 is displayed, it means there is an error in the specification for the start position of the SUBSTR function. The specification format for the SUBSTR function is as follows:

SUBSTR(character-string-data-of-extraction-source, start-position(, number-of-characters-to-be-extracted))
bb....bb:

Scalar function name

cc....cc: Position number of the query that specified bb....bb

For details about query position numbers, see 1.5 Query position numbers.

S:

Ignores this SQL statement. Alternatively, the system invalidates this transaction.

Action:

Correct the SQL statement according to rules for scalar function bb....bb. For details about the rules for scalar functions, see Scalar Functions in the manual HADB SQL Reference.

The possible errors are as follows:

  • If data whose data type cannot be specified for the argument indicated by aa....aa is specified

    For the argument indicated by aa....aa, specify data whose data type can be specified.

  • If the data type of the data specified for the argument indicated by aa....aa cannot be compared with the data type of the data specified for other arguments

    For the argument indicated by aa....aa and other arguments, specify data whose data type can be compared.

    For example, if you execute the following SQL statements with character string data that is the predefined character-string representation for datetime data specified as the argument, this message might be displayed.

    ▪ Example of SQL statement specification (For a column specification where "CDATE" is DATE type)

    • COALESCE ("CDATE", '2000/01/01')

    • LTDECODE ('2000/01/01', '2010/01/01', 0, "CDATE", 1)

    For the rules for specifying character string data that is the predefined character-string representation for datetime data, follow the rules for scalar function bb....bb. For details about the rules for scalar functions, see Scalar Functions in the manual HADB SQL Reference.

  • If only a single dynamic parameter is specified for the argument indicated by aa....aa

    Use the scalar functions CAST or CONVERT to specify a dynamic parameter. Alternatively, do not use a dynamic parameter.

    The following shows an example of specifying a dynamic parameter by using the scalar functions CAST and CONVERT.

    • Example of specifying a dynamic parameter by using the scalar function CAST

      CAST(? AS CHAR(10))

    • Example of specifying a dynamic parameter by using the scalar function CONVERT

      CONVERT(?, CHAR(10))