IBM Db2 - The Ultimate Database for Cloud, Analytics & Mobile
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.
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.