Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2012
    Posts
    24

    Unanswered: Db2 9.7 SP4 error code 840 with Hibernate

    Hi,

    We are using hibernate (annotations) with DB2 9.7. We have a parent table with many child tables (a lot, and this will not be changed). When hibernate creates a select query, the select statement list gets so large that DB2 throws error code 840.

    Has anyone had experience with similar problem? Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    look at sqlcode
    SQL0840N
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Aug 2012
    Posts
    24
    Quote Originally Posted by przytula_guy View Post
    look at sqlcode
    SQL0840N
    The error code states that too many records are retrieved with the select statement. However, if I end the statement with "FETCH FIRST 1 ROWS ONLY", it doesn't alter the result, I still get the same error code.

    Therefore I still believe the problem is in that the select statement in itself is simply too large.

  4. #4
    Join Date
    Aug 2012
    Posts
    24
    Ah, I see. So you meant that the returned combined column list is just too wide. This is something we cannot change since Hibernate generates the query.

    So the original problem remains

  5. #5
    Join Date
    Apr 2012
    Posts
    1,034
    Provided Answers: 18
    So how many columns *exactly* are you returning - have you traced hibernate to show the full query going to DB2?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •