G
Guest
Microsoft .NET Framework 2.0.50727
..NET Framework Data Provider for Oracle
Oracle9i Release 9.2.0.7.0
Some TimestampWithTZ values (e.g. "01-JAN-70 01.00.00.000000 AM
EUROPE/BERLIN") can not be read from an oracle database.
I receive the following Exception:
System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal
'parameter #5': Invalid managed/unmanaged type combination (Int16/UInt16 must
be paired with I2 or U2).
at System.Data.Common.UnsafeNativeMethods.OCIDateTimeFromArray(OciHandle
hndl, OciHandle err, Byte[] inarray, UInt32 len, DATATYPE type, OciHandle
datetime, OciHandle reftz, Byte fsprec)
at System.Data.OracleClient.OracleDateTime.GetBytes(NativeBuffer buffer,
Int32 valueOffset, Int32 lengthOffset, MetaType metaType, OracleConnection
connection)
at System.Data.OracleClient.OracleDateTime.MarshalToDateTime(NativeBuffer
buffer, Int32 valueOffset, Int32 lengthOffset, MetaType metaType,
OracleConnection connection)
at
System.Data.OracleClient.OracleColumn.GetDateTime(NativeBuffer_RowBuffer
buffer)
at System.Data.OracleClient.OracleColumn.GetValue(NativeBuffer_RowBuffer
buffer)
at System.Data.OracleClient.OracleDataReader.GetValues(Object[] values)
at
System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset,
DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32
startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object
parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables,
IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32
startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at
WindowsApplication2.DataSet1TableAdapters.TEST_TIMETableAdapter.Fill(TEST_TIMEDataTable
dataTable) in C:\CS2\WindowsApplication2\DataSet1.Designer.cs:line 612
at WindowsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in
C:\CS2\WindowsApplication2\Form1.cs:line 29
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Output from oracle SQL Plus:
SQL> select change_dt,dump(change_dt) from test_time;
CHANGE_DT
---------------------------------------------------------
DUMP(CHANGE_DT)
---------------------------------------------------------
01-JAN-70 01.00.00.000000 AM EUROPE/BERLIN
Typ=181 Len=13: 119,170,1,1,1,1,1,0,0,0,0,133,252
01-JAN-70 01.00.00.000000 AM +01:00
Typ=181 Len=13: 119,170,1,1,1,1,1,0,0,0,0,21,60
The first value causes the problem. The second one can be read without
problems.
According to oracle documents bytes 11 and 12 hold Region id or Timezone
Hour/Minute. I think the Region id can not be handled by the data provider.
Is this a known Bug?
Best regards,
Herwig
..NET Framework Data Provider for Oracle
Oracle9i Release 9.2.0.7.0
Some TimestampWithTZ values (e.g. "01-JAN-70 01.00.00.000000 AM
EUROPE/BERLIN") can not be read from an oracle database.
I receive the following Exception:
System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal
'parameter #5': Invalid managed/unmanaged type combination (Int16/UInt16 must
be paired with I2 or U2).
at System.Data.Common.UnsafeNativeMethods.OCIDateTimeFromArray(OciHandle
hndl, OciHandle err, Byte[] inarray, UInt32 len, DATATYPE type, OciHandle
datetime, OciHandle reftz, Byte fsprec)
at System.Data.OracleClient.OracleDateTime.GetBytes(NativeBuffer buffer,
Int32 valueOffset, Int32 lengthOffset, MetaType metaType, OracleConnection
connection)
at System.Data.OracleClient.OracleDateTime.MarshalToDateTime(NativeBuffer
buffer, Int32 valueOffset, Int32 lengthOffset, MetaType metaType,
OracleConnection connection)
at
System.Data.OracleClient.OracleColumn.GetDateTime(NativeBuffer_RowBuffer
buffer)
at System.Data.OracleClient.OracleColumn.GetValue(NativeBuffer_RowBuffer
buffer)
at System.Data.OracleClient.OracleDataReader.GetValues(Object[] values)
at
System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset,
DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32
startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object
parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables,
IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32
startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at
WindowsApplication2.DataSet1TableAdapters.TEST_TIMETableAdapter.Fill(TEST_TIMEDataTable
dataTable) in C:\CS2\WindowsApplication2\DataSet1.Designer.cs:line 612
at WindowsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in
C:\CS2\WindowsApplication2\Form1.cs:line 29
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Output from oracle SQL Plus:
SQL> select change_dt,dump(change_dt) from test_time;
CHANGE_DT
---------------------------------------------------------
DUMP(CHANGE_DT)
---------------------------------------------------------
01-JAN-70 01.00.00.000000 AM EUROPE/BERLIN
Typ=181 Len=13: 119,170,1,1,1,1,1,0,0,0,0,133,252
01-JAN-70 01.00.00.000000 AM +01:00
Typ=181 Len=13: 119,170,1,1,1,1,1,0,0,0,0,21,60
The first value causes the problem. The second one can be read without
problems.
According to oracle documents bytes 11 and 12 hold Region id or Timezone
Hour/Minute. I think the Region id can not be handled by the data provider.
Is this a known Bug?
Best regards,
Herwig