HASH scalar function change

In IBM® i 7.4, the HASH function has been renamed to HASH_VALUES. Any use of the HASH function as defined prior to IBM i 7.4 must be changed to use the renamed version of this function, HASH_VALUES.

This change was required to allow the introduction of a new Db2® standard function named HASH.

A reference to the prior HASH function is likely to encounter several errors since the input parameters and result data type of the new HASH function are different. Some common SQLCODEs are: SQL0303 when attempting to assign the result of HASH to a variable, SQL0171 if the data type of the second argument is not correct, and SQL0170 if more than 2 arguments are specified.

To identify static statements in embedded SQL programs and service programs that use a function named HASH, run the following SQL statement.
WITH program_statements(naming_mode, dec_point, string_delim, stmt_text,
    program_library, program_name, program_type)
    AS (SELECT a.naming, a.decimal_point, a.sql_string_delimiter, b.statement_text,
               a.program_schema, a.program_name, a.program_type
          FROM qsys2.sysprogramstat a INNER JOIN
               qsys2.sysprogramstmtstat b ON a.program_schema = b.program_schema AND
                                             a.program_name = b.program_name AND
                                             a.module_name = b.module_name 
          WHERE  a.number_statements > 0)      
SELECT program_library, program_name, program_type, stmt_text
    FROM program_statements, 
    TABLE(qsys2.parse_statement(stmt_text, naming_mode, dec_point, string_delim)) c
    WHERE c.name_type = 'FUNCTION' and c.name = 'HASH'
    ORDER BY 1, 2;