Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public bool EOF()
 {
     if (_cursor != null)
     {
         return(_cursor.EOF());
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
 protected override bool InternalEOF()
 {
     return(FSourceCursor.EOF());
 }