示例#1
0
        public bool Fetch()
        {
            int status = 0;

            if (this.disposed)
            {
                throw new InvalidOperationException("StatementHandle is already disposed.");
            }

            status = OciCalls.OCIStmtFetch(Handle,
                                           ErrorHandle.Handle,
                                           1,
                                           2,
                                           0);

            switch (status)
            {
            case OciGlue.OCI_NO_DATA:
                moreResults = false;
                foreach (IntPtr h in parm)
                {
                    OciCalls.OCIDescriptorFree(h, OciHandleType.Parameter);
                }
                break;

            case OciGlue.OCI_DEFAULT:
                moreResults = true;
                break;

            case OciGlue.OCI_SUCCESS_WITH_INFO:
                //OciErrorInfo ei = ErrorHandle.HandleError ();
                //command.Connection.CreateInfoMessage (ei);
                moreResults = true;
                break;

            default:
                OciErrorInfo info = ErrorHandle.HandleError();
                throw new OracleException(info.ErrorCode, info.ErrorMessage);
            }

            return(moreResults);
        }
示例#2
0
        protected override void FreeHandle()
        {
            // Parameter handles are disposed implicitely
            if (HandleType >= OciHandleType.LobLocator)
            {
                switch (HandleType)
                {
                case OciHandleType.Parameter:
                case OciHandleType.TimeStamp:
                    break;

                default:
                    if (Handle != IntPtr.Zero)
                    {
                        OciCalls.OCIDescriptorFree(this, HandleType);
                        SetHandle(IntPtr.Zero);
                    }
                    break;
                }
            }
        }