I want to share one of mine recent experience on SQL -804 with SQLSTATE 7002. It a standalone COBOL/DB2 program with simple select from single db2 object with one predicate in WHERE clause.

There are some validation and padding is going for the predicate prior to invoke the sql exec. But it becomes really strange when invoking the SQL it provided the SQL error as mentioned which is really unusual for any kind simple SELECT execs for program which does not use SQLDA(using dynamic sqls). While doing RCA we found below point.

RCA :-

While RCA we found that the logic for padding the predicate variable is extending the memory location of WS and corrupting/over riding the SQLCA itself for which it gives the SQLDA error.

Hope it would help some others on digging. Also I think we need to have discuss on this on a forum for which posting.

Views: 215

Reply to This

Bringing Db2 enthusiasts together virtually. Expert or novice, distributed or mainframe, this is the place for everything DB2.

User Groups

Blog Posts

New SQL pagination syntax - a Db2 12 greatest hit with John Campbell

Posted by Paul McWilliams on May 22, 2018 at 21:25 0 Comments

Db2 12 for z/OS introduces new SQL syntax that makes the difficult task of coding efficient SQL pagination—returning a portion of a result set based on data position—much easier for application developers. Read more in…



  • Add Videos
  • View All

© 2018   Created by Surekha Parekh.   Powered by

Badges  |  Report an Issue  |  Terms of Service