<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Ruslan, list,<div><br></div><div>do we have in valentina sql something like cursor.recordcount ?</div><div><br></div><div>In a stored procedure i have this :</div><div><br></div><div>this is part of the procedure (somewhere in the middle)</div><div>----------------------</div><div><div>declare cells_cur1 cursor for select tbl_cells.recid, core_syncid from tbl_cells where core_syncid in (select distinct member_group_id from advita_import);</div><div>declare cellRecID,cellcore_sync llong;</div><div>open cells_cur1;</div><div>fetch first cells_cur1 into cellRecID,cellcore_sync;</div><div>loop</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>BEGIN</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>update advita_import set cell_recid = cellRecID where member_group_id = cellcore_sync;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fetch next cells_cur1 into cellRecID,cellcore_sync;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>exception</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>when 56503 then</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>leave</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end</div><div>end loop</div><div>close cells_cur1;</div><div>-----------------</div><div>when I run this proc I get an error </div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 0, 0); "><span style="color: #3b1414"> 10:30:21 </span>Kernel error: 0x56503. Cursor "cells_cur1" failed to do "FirstRecord".</div><div><font class="Apple-style-span" color="#FF0000" face="Monaco"><br></font></div><div><font class="Apple-style-span" color="#FF0000" face="Monaco"><br></font></div></div><div>Now I understand why this happens but do I really have to build another cursor counting the records before trying to do 'firstrecord' ?</div><div>There seems to be no equivalent of curs.recordcount in sql ?</div><div><br></div><div>tia</div><div><br></div><div>Bart</div><div><br></div></div></body></html>