Hi everybody,
we're migrating to managed version of Oracle data access libraries and we have some code that runs ok in Oracle.dataaccess but Oracle.ManagedDataAccess returns an ORA-00942.
The reason for the exception is that the datatable we are updating into a TABLE and the table itself doesn't have the same fields
(BUT it runs ok with the unmanaged version of the library !!)
We get a datatable from a JOIN query like this:
dt :== SELECT l.*, h.ds FROM linea L INNER JOIN h ON l.id = h.id WHERE id = 5365
and we want to update the table LINEA.
//p_conexion is an opened and active connection with an Oracle DB
Dim adaptador As New Oracle.ManagedDataAccess.Client.OracleDataAdapter
Dim comando As Oracle.ManagedDataAccess.Client.OracleCommand
Dim constructor As New Oracle.ManagedDataAccess.Client.OracleCommandBuilder
constructor = New OracleCommandBuilder(adaptador)
constructor.ConflictOption = ConflictOption.OverwriteChanges
comando.CommandText = "SELECT * FROM LINEA WHERE id=1"
comando.CommandType = CommandType.Text
adaptador.SelectCommand = comando
adaptador.SelectCommand.Connection = p_conexion
adaptador.Update(dt) 'Here, dt has one more field -ds- than the table LINEA in DB.
'This sentence -adaptador.Update(dt)- throw an exception with ORA-00942.
Can anyone help me with that issue?
- Unmanaged version: 2.112.2.0
- Managed version: 4.122.18.3
thanks a lot!