Exemple #1
0
        public void TestDeleteAtBOF()
        {
            ExecuteScript("create table TestDeleteAtBOF { ID : Integer, Name : String, key { ID } };");
            ExecuteScript("insert row { 1 ID, 'Joe' Name } into TestDeleteAtBOF;");
            ExecuteScript("insert row { 2 ID, 'John' Name } into TestDeleteAtBOF;");

            IServerCursor LCursor = Process.OpenCursor("select TestDeleteAtBOF browse by { ID } capabilities { navigable, backwardsnavigable, bookmarkable, searchable, updateable } isolation browse", null);

            try
            {
                var LRow = LCursor.Plan.RequestRow();
                try
                {
                    LCursor.Last();
                    LCursor.Prior();
                    LCursor.Prior();
                    LCursor.Delete();
                    if (LCursor.BOF() && !LCursor.Next())
                    {
                        throw new Exception("Delete At BOF Failed");
                    }
                }
                finally
                {
                    LCursor.Plan.ReleaseRow(LRow);
                }
            }
            finally
            {
                Process.CloseCursor(LCursor);
            }
        }
Exemple #2
0
 public bool BOF()
 {
     if (_cursor != null)
     {
         return(_cursor.BOF());
     }
     else
     {
         return(true);
     }
 }
Exemple #3
0
        public void TestDeleteAtBOF()
        {
            IServerProcess LProcess = DataSession.ServerSession.StartProcess(new ProcessInfo(DataSession.SessionInfo));

            try
            {
                var LFetchCount = DataSession.ServerSession.SessionInfo.FetchCount;
                LProcess.Execute("create table TestDeleteAtBOF { ID : Integer, Name : String, key { ID } };", null);
                LProcess.Execute("insert row { 1 ID, 'Joe' Name } into TestDeleteAtBOF;", null);
                LProcess.Execute("insert row { 2 ID, 'John' Name } into TestDeleteAtBOF;", null);

                IServerCursor LCursor = LProcess.OpenCursor("select TestDeleteAtBOF browse by { ID } capabilities { navigable, backwardsnavigable, bookmarkable, searchable, updateable } isolation browse", null);
                try
                {
                    var LRow = LCursor.Plan.RequestRow();
                    try
                    {
                        LCursor.Last();
                        LCursor.Prior();
                        LCursor.Prior();
                        LCursor.Delete();
                        if (LCursor.BOF() && !LCursor.Next())
                        {
                            throw new Exception("Delete At BOF failed");
                        }
                    }
                    finally
                    {
                        LCursor.Plan.ReleaseRow(LRow);
                    }
                }
                finally
                {
                    LProcess.CloseCursor(LCursor);
                }
            }
            finally
            {
                DataSession.ServerSession.StopProcess(LProcess);
            }
        }
 protected override bool InternalBOF()
 {
     return(FSourceCursor.BOF());
 }