public void TestDeleteAtEOF() { ExecuteScript("create table TestDeleteAtEOF { ID : Integer, Name : String, key { ID } };"); ExecuteScript("insert row { 1 ID, 'Joe' Name } into TestDeleteAtEOF;"); ExecuteScript("insert row { 2 ID, 'John' Name } into TestDeleteAtEOF;"); IServerCursor LCursor = Process.OpenCursor("select TestDeleteAtEOF browse by { ID } capabilities { navigable, backwardsnavigable, bookmarkable, searchable, updateable } isolation browse", null); try { var LRow = LCursor.Plan.RequestRow(); try { LCursor.Next(); LCursor.Next(); LCursor.Delete(); if (LCursor.EOF() && !LCursor.Prior()) { throw new Exception("Delete At EOF Failed"); } } finally { LCursor.Plan.ReleaseRow(LRow); } } finally { Process.CloseCursor(LCursor); } }
public override bool Read() { if (_cursor.Next()) { if (_internalRow == null) { _internalRow = new DAE.Runtime.Data.Row(_cursor.Plan.Process.ValueManager, ((TableType)_cursor.Plan.DataType).RowType); } _cursor.Select(_internalRow); if (!_cursor.EOF()) { _rowCount++; } return(!_cursor.EOF()); } else { return(false); } }
public bool EOF() { if (_cursor != null) { return(_cursor.EOF()); } else { return(true); } }
public void TestDeleteAtEOF() { IServerProcess LProcess = DataSession.ServerSession.StartProcess(new ProcessInfo(DataSession.SessionInfo)); try { var LFetchCount = DataSession.ServerSession.SessionInfo.FetchCount; LProcess.Execute("create table TestDeleteAtEOF { ID : Integer, Name : String, key { ID } };", null); LProcess.Execute("insert row { 1 ID, 'Joe' Name } into TestDeleteAtEOF;", null); LProcess.Execute("insert row { 2 ID, 'John' Name } into TestDeleteAtEOF;", null); IServerCursor LCursor = LProcess.OpenCursor("select TestDeleteAtEOF browse by { ID } capabilities { navigable, backwardsnavigable, bookmarkable, searchable, updateable } isolation browse", null); try { var LRow = LCursor.Plan.RequestRow(); try { LCursor.Next(); LCursor.Next(); LCursor.Delete(); if (LCursor.EOF() && !LCursor.Prior()) { throw new Exception("Delete At EOF failed"); } } finally { LCursor.Plan.ReleaseRow(LRow); } } finally { LProcess.CloseCursor(LCursor); } } finally { DataSession.ServerSession.StopProcess(LProcess); } }
protected override bool InternalEOF() { return(FSourceCursor.EOF()); }