Esempio n. 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);
            }
        }
Esempio n. 2
0
 public void Last()
 {
     if (_cursor != null)
     {
         _cursor.Last();
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 4
0
 protected override void InternalLast()
 {
     FSourceCursor.Last();
 }