just a random pick

SQL Code : -119

A COLUMN IDENTIFIED IN A HAVING CLAUSE IS NOT INCLUDED IN THE GROUP BY CLAUSE

Explanation :

A column or expression identified in aHAVING clause, possibly within a scalar function, doesnot appear in the GROUP BY clause. Columns orexpressions specified in a HAVING clause must appearwithin aggregate functions or also be specified in theGROUP BY clause.

Grouping expressions can be used in a search conditionin a HAVING clause. A grouping expression specifiesonly one value for each group. A grouping expressionspecified in this context must exactly match a groupingexpression specified in the GROUP BY clause, with theexception of blanks, which are not significant.

SQL STATE : 42803

When DB2 executes an SQL statement, it returns information about the statement execution which includes the SQL return code (SQLCODE) and the SQLSTATE, which indicate whether statement execution was successful.

Regardless of whether the application program provides an SQLCA or a stand-alone variable, SQLCODE is set by DB2 after each SQL statement is executed. DB2 conforms to the ISO/ANSI SQL standard as follows:

  • If SQLCODE = 0, execution was successful.
  • If SQLCODE > 0, execution was successful with a warning.
  • If SQLCODE < execution was not successful.

Suggestion / Complaint / Feedback