× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: SQL cursor error on AS400
  • From: "Xu, Weining" <Weining.Xu@xxxxxxx>
  • Date: Tue, 24 Apr 2001 14:12:32 -0400

Title: RE: SQL cursor error on AS400

following my question yesterday.

I have checked my spool file, I got:

 Message . . . . :   Operation sequence for member UNIT_PROD not valid. (C I)  
 Cause . . . . . :   An update or delete was requested before a get for update 
   for member UNIT_PROD file UNIT_PROD in library AGTCOMP.
Recovery  . . . :   
   Either change the operation sequence in the program or delete the existing  
   program and compile it again.  Then try the request again. Possible choices 
   for replying to message . . . . . . . . . . . . . . . :   C -- The request  
   is canceled. I -- Ignore the request and continue processing.     

 Message . . . . :   Cursor SQLCURSOR000000003 not positioned on locked row.   
 Cause . . . . . :   An UPDATE or DELETE statement with a WHERE CURRENT OF     
   SQLCURSOR000000003 was attempted, but the cursor is not positioned on a row 
   or is positioned on a row, but the row is not locked because a COMMIT HOLD  
   or ROLLBACK HOLD statement released the lock on the row. A FETCH statement  
   must be issued to position the cursor on a row and lock the row.
Recovery  . . . :   Issue a FETCH statement to position the cursor on a row and lock the
   row; then, try the request again. 

For message 1: My program sequence is to load some data into a table with some columns null, then update these coloumns by using the results from the calculation. Loading is completed before the update. Why wrong here?

For message 2:  I use JDBC Statement and ResultSet objects, and use rs.next() for moving the cursor, then rs.updateXXX(); rs.updateRow(); The connection was setAutoCommit as true.  It does not need to have a FETCH statement since JDBC API take care of it.  Why is wrong here?

Also the loading process was done as a transaction, which means I have setAutoCommit(false), after all insertion completed, I did:

con.commit();
con.setAutoCommit(true);
This should be Ok too. 

In fact, there is nothing wrong when I run the program on NT.

Is there any possible incompatible of the JDBC2.0  API between AS400 DB2 and NT?  By the way I use JDK1.2.2 on my AS/400.





As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.