Example #1
0
        internal OciRowIdDescriptor GetAttributeRowIdDescriptor(OciErrorHandle errorHandle, OciHandle env)
        {
            OciRowIdDescriptor descriptor = null;
            IntPtr             outputPtr  = IntPtr.Zero;
            int outSize = 16;
            int status  = 0;
            OciAttributeType attrType = OciAttributeType.RowId;

            outputPtr = OciCalls.AllocateClear(outSize);

            uint siz = (uint)outSize;

            status = OCIAttrGetRowIdDesc(Handle,
                                         HandleType,
                                         outputPtr,
                                         ref siz,
                                         attrType,
                                         errorHandle);

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

            if (outputPtr != IntPtr.Zero && siz > 0)
            {
                descriptor = (OciRowIdDescriptor)env.Allocate(OciHandleType.RowId);
                descriptor.SetHandle(outputPtr);
            }

            return(descriptor);
        }
Example #2
0
        internal string GetAttributeString(OciAttributeType attrType, OciErrorHandle errorHandle)
        {
            string output    = String.Empty;
            IntPtr outputPtr = IntPtr.Zero;
            int    outSize;
            int    status = 0;

            status = OciCalls.OCIAttrGet(Handle,
                                         HandleType,
                                         out outputPtr,
                                         out outSize,
                                         attrType,
                                         errorHandle);

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

            if (outputPtr != IntPtr.Zero && outSize > 0)
            {
                object str = Marshal.PtrToStringAnsi(outputPtr, outSize);
                if (str != null)
                {
                    output = String.Copy((string)str);
                }
            }

            return(output);
        }
Example #3
0
 internal static int OCIAttrGetIntPtr(IntPtr trgthndlp,
     OciHandleType trghndltyp,
     out IntPtr attributep,
     IntPtr sizep,
     OciAttributeType attrtype,
     IntPtr errhp)
 {
     #if TRACE
     Trace.WriteLineIf(traceOci, "OCIAttrGetIntPtr", "OCI");
     #endif
     return OciNativeCalls.OCIAttrGetIntPtr (trgthndlp, trghndltyp, out attributep, sizep, attrtype, errhp);
 }
Example #4
0
 internal static int OCIAttrSetString(IntPtr trgthndlp,
     OciHandleType trghndltyp,
     string attributep,
     uint size,
     OciAttributeType attrtype,
     IntPtr errhp)
 {
     #if TRACE
     Trace.WriteLineIf(traceOci, string.Format("OCIAttrSetString ({0}, {1})", trghndltyp, attrtype), "OCI");
     #endif
     return OciNativeCalls.OCIAttrSetString (trgthndlp, trghndltyp, attributep, size, attrtype, errhp);
 }
Example #5
0
        internal static int OCIAttrGetRowIdDesc(IntPtr trgthndlp,
                                                [MarshalAs(UnmanagedType.U4)] OciHandleType trghndltyp,
                                                IntPtr attributep,
                                                ref uint sizep,
                                                [MarshalAs(UnmanagedType.U4)] OciAttributeType attrtype,
                                                IntPtr errhp)
        {
#if TRACE
            Trace.WriteLineIf(traceOci, "OCIAttrGetRowIdDesc", OCI_DLL);
#endif
            return(OciNativeCalls.OCIAttrGetRowIdDesc(trgthndlp, trghndltyp, attributep, ref sizep, attrtype, errhp));
        }
Example #6
0
        internal static int OCIAttrGetUInt16(IntPtr trgthndlp,
                                             OciHandleType trghndltyp,
                                             out ushort attributep,
                                             IntPtr sizep,
                                             OciAttributeType attrtype,
                                             IntPtr errhp)
        {
#if TRACE
            Trace.WriteLineIf(traceOci, "OCIAttrGetUInt16", OCI_DLL);
#endif

            return(OciNativeCalls.OCIAttrGetUInt16(trgthndlp, trghndltyp, out attributep, sizep, attrtype, errhp));
        }
Example #7
0
        internal void SetAttributeString(string attribute, OciAttributeType attrType, OciErrorHandle errorHandle)
        {
            int status = 0;

            status = OciCalls.OCIAttrSetString(Handle,
                                               HandleType,
                                               attribute,
                                               (uint)attribute.Length,
                                               attrType,
                                               errorHandle);

            if (status != 0)
            {
                OciErrorInfo info = errorHandle.HandleError();
                throw new OracleException(info.ErrorCode, info.ErrorMessage);
            }
        }
Example #8
0
        internal IntPtr GetAttributeIntPtr(OciAttributeType attrType, OciErrorHandle errorHandle)
        {
            int    status = 0;
            IntPtr output = IntPtr.Zero;

            status = OciCalls.OCIAttrGetIntPtr(Handle,
                                               HandleType,
                                               out output,
                                               IntPtr.Zero,
                                               attrType,
                                               errorHandle);

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

            return(output);
        }
Example #9
0
 internal static extern int OCIAttrGetUInt16(IntPtr trgthndlp,
     [MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
     out ushort attributep,
     IntPtr sizep,
     [MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
     IntPtr errhp);
		public bool GetAttributeBool (OciAttributeType attrType, OciErrorHandle errorHandle) {
			return (GetAttributeInt32 (attrType, errorHandle) != 0);
		}
Example #11
0
 internal bool GetAttributeBool(OciAttributeType attrType, OciErrorHandle errorHandle)
 {
     return(GetAttributeInt32(attrType, errorHandle) != 0);
 }
Example #12
0
 internal static extern int OCIAttrGetRowIdDesc(IntPtr trgthndlp,
                                                [MarshalAs(UnmanagedType.U4)] OciHandleType trghndltyp,
                                                IntPtr attributep,
                                                ref uint sizep,
                                                [MarshalAs(UnmanagedType.U4)] OciAttributeType attrtype,
                                                IntPtr errhp);
Example #13
0
		internal static int OCIAttrSetString (IntPtr trgthndlp,
			OciHandleType trghndltyp,
			string attributep,
			uint size,
			OciAttributeType attrtype,
			IntPtr errhp)
		{
			#if TRACE
			Trace.WriteLineIf(traceOci, string.Format("OCIAttrSetString ({0}, {1})", trghndltyp, attrtype), "OCI");
			#endif
			return OciNativeCalls.OCIAttrSetString (trgthndlp, trghndltyp, attributep, size, attrtype, errhp);
		}
Example #14
0
		internal static int OCIAttrGetIntPtr (IntPtr trgthndlp,
			OciHandleType trghndltyp,
			out IntPtr attributep,
			IntPtr sizep,
			OciAttributeType attrtype,
			IntPtr errhp)
		{
			#if TRACE
			Trace.WriteLineIf(traceOci, "OCIAttrGetIntPtr", "OCI");
			#endif
			return OciNativeCalls.OCIAttrGetIntPtr (trgthndlp, trghndltyp, out attributep, sizep, attrtype, errhp);
		}
		public void SetAttributeString (string attribute, OciAttributeType attrType, OciErrorHandle errorHandle) 
		{
			int status = 0;
			
			status = OciCalls.OCIAttrSetString (Handle,
				HandleType,
				attribute,
				(uint) attribute.Length,
				attrType,
				errorHandle);

			if (status != 0) {
				OciErrorInfo info = errorHandle.HandleError ();
				throw new OracleException (info.ErrorCode, info.ErrorMessage);
			}
		}
		public string GetAttributeString (OciAttributeType attrType, OciErrorHandle errorHandle) {
			string output = String.Empty;
			IntPtr outputPtr = IntPtr.Zero;
			int outSize;
			int status = 0;

			status = OciCalls.OCIAttrGet (Handle,
				HandleType,
				out outputPtr,
				out outSize,
				attrType,
				errorHandle);

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

			if (outputPtr != IntPtr.Zero && outSize > 0) {
				object str = Marshal.PtrToStringAnsi (outputPtr, outSize);
				if (str != null) 
					output = String.Copy ((string) str);
			}

			return output;
		}
Example #17
0
 internal static extern int OCIAttrSetString(IntPtr trgthndlp,
     [MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
     string attributep,
     uint size,
     [MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
     IntPtr errhp);
Example #18
0
		internal sbyte GetAttributeSByte (OciAttributeType attrType, OciErrorHandle errorHandle) {
			int status = 0;
			sbyte output;

			status = OciCalls.OCIAttrGetSByte (Handle,
				HandleType,
				out output,
				IntPtr.Zero,
				attrType,
				errorHandle);

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

			return output;
		}
Example #19
0
		internal int GetAttributeInt32 (OciAttributeType attrType, OciErrorHandle errorHandle) {
			int status = 0;
			int output;

			status = OciCalls.OCIAttrGetInt32 (Handle,
				HandleType,
				out output,
				IntPtr.Zero,
				attrType,
				errorHandle);

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

			return output;
		}
		public IntPtr GetAttributeIntPtr (OciAttributeType attrType, OciErrorHandle errorHandle) {
			int status = 0;
			IntPtr output = IntPtr.Zero;
			status = OciCalls.OCIAttrGetIntPtr (Handle,
				HandleType,
				out output,
				IntPtr.Zero,
				attrType,
				errorHandle);

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

			return output;
		}
Example #21
0
		internal static int OCIAttrGetInt32 (IntPtr trgthndlp,
			OciHandleType trghndltyp,
			out int attributep,
			IntPtr sizep,
			OciAttributeType attrtype,
			IntPtr errhp)
		{
			Trace.WriteLineIf(traceOci, "OCIAttrGetInt32", "OCI");
			return OciNativeCalls.OCIAttrGetInt32 (trgthndlp, trghndltyp, out attributep, sizep, attrtype, errhp);
		}