IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Impact of SQL error -354 on ROWSET


 
IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajayhegdemainframe

New User


Joined: 05 Jun 2013
Posts: 5
Location: Mumbai, India

PostPosted: Tue Oct 22, 2013 11:28 pm
Reply with quote

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
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Oct 23, 2013 12:10 pm
Reply with quote

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
View user's profile Send private message
ajayhegdemainframe

New User


Joined: 05 Jun 2013
Posts: 5
Location: Mumbai, India

PostPosted: Wed Oct 23, 2013 12:40 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Getting error while xped JCL & VSAM 7
No new posts can someone please help me in finding... IBM Tools 9
No new posts SYNCSORT Error - CONTROL FIELD BEYOND... SYNCSORT 10
No new posts Easytrieve EZABX007 with error code 0... CA Products 7
No new posts SARBCH REPORT DD writing error CA Products 1

Back to Top