Esempio n. 1
0
 public uint Copy(OciLobLocator destination, uint amount, uint destinationOffset, uint sourceOffset)
 {
     OciCalls.OCILobCopy(Service,
                         ErrorHandle,
                         destination,
                         Handle,
                         amount,
                         destinationOffset,
                         sourceOffset);
     return(amount);
 }
Esempio n. 2
0
        void DefineLob(int position, OciDataType type, OracleConnection connection)
        {
            ociType = type;

            if (ociType == OciDataType.Clob)
            {
                fieldType = typeof(System.String);
            }
            else if (ociType == OciDataType.Blob)
            {
                fieldType = typeof(byte[]);
            }

            int status = 0;

            definedSize = -1;

            lobLocator = (OciLobLocator)connection.Environment.Allocate(OciHandleType.LobLocator);

            if (lobLocator == null)
            {
                OciErrorInfo info = connection.ErrorHandle.HandleError();
                throw new OracleException(info.ErrorCode, info.ErrorMessage);
            }

            value = lobLocator.Handle;
            lobLocator.ErrorHandle = connection.ErrorHandle;
            lobLocator.Service     = connection.ServiceContext;
            lobLocator.Environment = connection.Environment;

            status = OciCalls.OCIDefineByPosPtr(Parent,
                                                out handle,
                                                ErrorHandle,
                                                position + 1,
                                                ref value,
                                                definedSize,
                                                ociType,
                                                indicator,
                                                rlenp,
                                                IntPtr.Zero,
                                                0);

            definedSize = Int32.MaxValue;

            if (status != 0)
            {
                OciErrorInfo info = connection.ErrorHandle.HandleError();
                throw new OracleException(info.ErrorCode, info.ErrorMessage);
            }
        }