2 // OciRowIdDescriptor.cs
4 // Part of managed C#/.NET library System.Data.OracleClient.dll
6 // Part of the Mono class libraries at
7 // mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
9 // Assembly: System.Data.OracleClient.dll
10 // Namespace: System.Data.OracleClient.Oci
13 // Tim Coleman <tim@timcoleman.com>
15 // Copyright (C) Tim Coleman, 2003
19 using System.Data.OracleClient;
20 using System.Runtime.InteropServices;
22 namespace System.Data.OracleClient.Oci {
23 internal sealed class OciRowIdDescriptor : OciDescriptorHandle, IDisposable
27 bool disposed = false;
33 public OciRowIdDescriptor (OciHandle parent, IntPtr newHandle)
34 : base (OciHandleType.RowId, parent, newHandle)
38 #endregion // Constructors
43 FIXME: This method only exists in Oracle 9i
46 static extern int OCIRowidToChar (IntPtr rowidDesc,
52 protected override void Dispose (bool disposing)
56 base.Dispose (disposing);
60 [MonoTODO ("Find a way to get this with 8 or 9.")]
61 public string GetRowId (OciErrorHandle errorHandle)
63 string output = String.Empty;
66 IntPtr outputPtr = Marshal.AllocHGlobal (len); // FIXME: how big should this be?
70 status = OCIRowidToChar (this,
76 OciErrorInfo info = errorHandle.HandleError ();
77 throw new OracleException (info.ErrorCode, info.ErrorMessage);
80 if (outputPtr != IntPtr.Zero && len > 0) {
81 object str = Marshal.PtrToStringAnsi (outputPtr, len);
83 output = String.Copy ((string) str);
87 output = "NOT YET SUPPORTED.";