I could not reproduce your error with the latest ODAC version my dev team created. I also didn't find an existing bug that matched your symptoms that was fixed recently since you are using ODP.NET 12c from the Oracle DB 12c client. I got the same results running your sample code on both unmanaged and managed ODP.NET.
The ODP.NET, Managed Driver that is part of ODAC 12c will be out soon. Try that version.
Even if unmanaged ODP.NET didn't exist, the parameter output value should be 123456, not null.
"the latest ODAC version my dev team created"
Is it a next version of ODP.NET? Not 22.214.171.124.0 as in client?
Yes, the ODAC version that will becoming out soon is the one I tested with.
I guess it will be 126.96.36.199.0 ?
Yep, it is not reproducing on last ODAC version.
And what about this, Alex:
var cmd = conn.CreateCommand();
cmd.Parameters.Add("ln", OracleDbType.Varchar2, 32).Value = "aaaaaa";
cmd.Parameters.Add("dostep", OracleDbType.Byte).Direction = System.Data.ParameterDirection.Output;
cmd.CommandText = "update uzytkownik set lastlogintime=sysdate,acccnt=acccnt+1 where lower(login_nds)=:ln returning dostep into :dostep";
In użytkownik table there is no record with login_nds == "aaaaaa"
ExecuteNonQuery() crashes with stack:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index]
OracleInternal.TTC.Accessors.TTCNumberAccessor.GetByteRepresentation(Int32 currentRow) +28
OracleInternal.ServiceObjects.OracleParameterImpl.ExtractIntFromAccessor(Accessor accessor, PrmEnumType enumType, OracleDbType oraDbType, Int32 currentRow) +313
OracleInternal.ServiceObjects.OracleParameterImpl.GetIntFromBytes(Accessor accessor, PrmEnumType enumType, OracleDbType oraDbType) +279
Oracle.ManagedDataAccess.Client.OracleParameter.PostBind_Int32(Accessor bindAccessor) +259
OracleInternal.ServiceObjects.OracleCommandImpl.ExtractAccessorValuesIntoParam(OracleParameterCollection paramColl, OracleConnection connection, String commandText, Int64 longFetchSize, Int64 lobFetchSize, Int64 scnFromExecution) +756
There was no record selected by a query, so returning clause couldn't return a thing
ODP.NET crashed in this scenario - this is a bug in my opinion
package id="odp.net.managed" version="121.1.1" targetFramework="net40" />