IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top