示例#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);
            }
        }
示例#2
0
 public bool Prior()
 {
     if (_cursor != null)
     {
         return(_cursor.Prior());
     }
     else
     {
         return(false);
     }
 }
示例#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);
            }
        }
示例#4
0
 protected override void InternalPrior()
 {
     FSourceCursor.Prior();
 }