New test.
[mono.git] / mcs / class / System.Data.OracleClient / System.Data.OracleClient.Oci / OciRowIdDescriptor.cs
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 <tim@timcoleman.com>
14 //         
15 // Copyright (C) Tim Coleman, 2003
16 // 
17
18 using System;
19 using System.Data.OracleClient;
20 using System.Runtime.InteropServices;
21
22 namespace System.Data.OracleClient.Oci {
23         internal sealed class OciRowIdDescriptor : OciDescriptorHandle, IDisposable
24         {
25                 #region Fields
26
27                 bool disposed = false;
28
29                 #endregion // Fields
30
31                 #region Constructors
32
33                 public OciRowIdDescriptor (OciHandle parent, IntPtr newHandle)
34                         : base (OciHandleType.RowId, parent, newHandle)
35                 {
36                 }
37
38                 #endregion // Constructors
39
40                 #region Methods
41
42                 
43                 //FIXME: This method only exists in Oracle 9i
44 /*
45                 [DllImport ("oci")] 
46                 static extern int OCIRowidToChar (IntPtr rowidDesc,
47                                                 IntPtr outbfp,
48                                                 ref int outbflp,
49                                                 IntPtr errhp);
50 */              
51
52                 protected override void Dispose (bool disposing)
53                 {
54                         if (!disposed) {
55                                 disposed = true;
56                                 base.Dispose (disposing);
57                         }
58                 }
59
60                 [MonoTODO ("Find a way to get this with 8 or 9.")]
61                 public string GetRowId (OciErrorHandle errorHandle)
62                 {
63                         string output = String.Empty;
64 /*                      
65                         int len = 10;
66                         IntPtr outputPtr = Marshal.AllocHGlobal (len); // FIXME: how big should this be?
67
68                         int status = 0;
69
70                         status = OCIRowidToChar (this,
71                                                 outputPtr,
72                                                 ref len,
73                                                 errorHandle);
74
75                         if (status != 0) {
76                                 OciErrorInfo info = errorHandle.HandleError ();
77                                 throw new OracleException (info.ErrorCode, info.ErrorMessage);
78                         }
79
80                         if (outputPtr != IntPtr.Zero && len > 0) {
81                                 object str = Marshal.PtrToStringAnsi (outputPtr, len);
82                                 if (str != null)
83                                         output = String.Copy ((string) str);
84                         }
85 */                      
86                         output = "NOT YET SUPPORTED.";
87
88                         return output;
89                 } 
90
91                 #endregion // Methods
92         }
93 }