![Sqlrpgle Sqlrpgle](http://2.bp.blogspot.com/-sX2wkefPlTw/T_ZVILz1QRI/AAAAAAAABeA/jV3tAsjj2a8/s1600/Android%2BListview%2BCursorAdapter%2BSQLite%2BExample.png)
Changing from good old READE loops to SQL FOR Loops simply means using the SQL CURSOR function. Update an IBM i file with SQL cursor using.
Posted By — DB2 SQL CURSOR: POSITIONED UPDATE & DELETE When processing a CURSOR, DB2 SQL give option to update or delete data in base table based on current position of CURSOR in result table. This is called POSITIONED UPDATE or POSITIONED DELETE. Let say there is a table EXAMPLETABLE like CREATE TABLE EXAMPLETABLE (id numeric, name char(10), processedFlag char(1)); id name processedFlag 1 SUMIT N 2 AMIT Y 3 JOHN N 4 ROHIT Y 1 SUMIT N You need to write some processing logic for each record of this table which is not processed yet(means processedFlag ‘Y’) and when processing for a record is completed processedFlag should be updated to ‘Y’.