View previous topic :: View next topic
|
Author |
Message |
ajayhegdemainframe
New User
Joined: 05 Jun 2013 Posts: 5 Location: Mumbai, India
|
|
|
|
Hello all,
We have an application code (cobol-db2 program) which purges data from a db2 table
High level Flow
- Rows to be deleted are Multi-fetched (200 rows at a time)
- Records moved to file
- Records deleted from table using the ROW-SET position
- Repeat step 1,2,3 until no records found for the purge conditions defined
===============================================
During testing in some instances we were facing SQLCODE -354 while multifetch and program abend
On checking explanation for the SQLCODE learnt its most often on warning conditions such errors are seen
Extract:
"DB2 processed the statement successfully, but with at least one
non-terminating error. Additionally, the fetching of some rows might have encountered warnings."
hence we changed logic a bit so that it will proceed to delete the records on SQLCODE zero & -354
Now the program executed the multifetch statement and went on to delete 200 records but it failed with SQLCODE -508
could some body be able to provide some insights on whether -354 error causes the Cursor ROWSET to change which is what the -508 error code states
Note: We are further investigating the cause of -354 error
Thank you |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
Code: |
GET DIAGNOSTICS :num_rows = ROW_COUNT, :num_cond = NUMBER
for n = 1 to num_cond
GET DIAGNOSTICS CONDITION n :sqlstate = RETURNED_SQLSTATE, :sqlcode = DB2_RETURNED_SQLCODE, :row_num = DB2_ROW_NUMBER
display ...
end-for |
should give you an idea |
|
Back to top |
|
|
ajayhegdemainframe
New User
Joined: 05 Jun 2013 Posts: 5 Location: Mumbai, India
|
|
|
|
Thanks GuyC, Will check on the diagnostics details to gain further info on the nature of error
fyi
The -354 error got resolved,The table had certain fields of MBCS nature ( as per SYSIBM.SYSCOLUMNS its CCSID 1208) ,hence declared respective host variables with CCSID 1208 in working storage section
Now purge job works fine
Thanks |
|
Back to top |
|
|
|