when a cursor is opened.. when a new row is insert into tabl



IBM's flagship relational database management system

when a cursor is opened.. when a new row is insert into tabl

Postby pradeepgowda » Thu Jan 28, 2010 11:18 am

during runtime, when a cursor is opened.. when a new row is inserted into the base table, that satisfies the condition in select clause of declare cursor.. will that row be included in the result table after open cursor statement..

ie consider a table employee
employid name
1152 pradeep
1162 gowda

exec sql
declare c2 cursor for select employeeid, name from employee
end-exec
at runtime, when a cursor is openend ,if a new row is added

1175 bob

will the new row be selected for the result table
pradeepgowda
 
Posts: 40
Joined: Mon Jan 04, 2010 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: when a cursor is opened.. when a new row is insert into tabl

Postby dick scherrer » Fri Jan 29, 2010 12:44 am

Hello,

will that row be included in the result table after open cursor statement..
Possibly. . .

If the cursor fetches rows directly from the database table, newly inserted rows can be retrieved during the process. If the cursor fetches rows from a temporary result table, new inserts will not be retrieved.

This can also happen with updates that cause the row to be "found later". . .

Suggest you talk with your dba about your specifics.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post