OciRowIdDescriptor.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // OciRowIdDescriptor.cs
  3. //
  4. // Part of managed C#/.NET library System.Data.OracleClient.dll
  5. //
  6. // Part of the Mono class libraries at
  7. // mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
  8. //
  9. // Assembly: System.Data.OracleClient.dll
  10. // Namespace: System.Data.OracleClient.Oci
  11. //
  12. // Author:
  13. // Tim Coleman <[email protected]>
  14. //
  15. // Copyright (C) Tim Coleman, 2003
  16. //
  17. using System;
  18. using System.Data.OracleClient;
  19. using System.Runtime.InteropServices;
  20. namespace System.Data.OracleClient.Oci {
  21. internal sealed class OciRowIdDescriptor : OciDescriptorHandle, IDisposable
  22. {
  23. #region Fields
  24. bool disposed = false;
  25. #endregion // Fields
  26. #region Constructors
  27. public OciRowIdDescriptor (OciHandle parent, IntPtr newHandle)
  28. : base (OciHandleType.RowId, parent, newHandle)
  29. {
  30. }
  31. #endregion // Constructors
  32. #region Methods
  33. //FIXME: This method only exists in Oracle 9i
  34. /*
  35. [DllImport ("oci")]
  36. static extern int OCIRowidToChar (IntPtr rowidDesc,
  37. IntPtr outbfp,
  38. ref int outbflp,
  39. IntPtr errhp);
  40. */
  41. protected override void Dispose (bool disposing)
  42. {
  43. if (!disposed) {
  44. disposed = true;
  45. base.Dispose (disposing);
  46. }
  47. }
  48. [MonoTODO ("Find a way to get this with 8 or 9.")]
  49. public string GetRowId (OciErrorHandle errorHandle)
  50. {
  51. string output = String.Empty;
  52. /*
  53. int len = 10;
  54. IntPtr outputPtr = Marshal.AllocHGlobal (len); // FIXME: how big should this be?
  55. int status = 0;
  56. status = OCIRowidToChar (this,
  57. outputPtr,
  58. ref len,
  59. errorHandle);
  60. if (status != 0) {
  61. OciErrorInfo info = errorHandle.HandleError ();
  62. throw new OracleException (info.ErrorCode, info.ErrorMessage);
  63. }
  64. if (outputPtr != IntPtr.Zero && len > 0) {
  65. object str = Marshal.PtrToStringAnsi (outputPtr, len);
  66. if (str != null)
  67. output = String.Copy ((string) str);
  68. }
  69. */
  70. output = "NOT YET SUPPORTED.";
  71. return output;
  72. }
  73. #endregion // Methods
  74. }
  75. }