This is clearly not what you want, but it seems that ODP.NET uses the length of the parameter on the .NET side as the length of the out parameter ...
This will fix your problem:
cmd.Parameters.Add("P_OUT_MESSAGE", OracleDbType.Varchar2, 32767, "x".PadRight(500, 'x'), ParameterDirection.Output);
But this is better, and although this is not entirely correct, it works:
cmd.Parameters.Add("P_OUT_MESSAGE", OracleDbType.Clob, ParameterDirection.Output);
Or, better yet, if possible, avoid using parameters outand use scalar return values or table functions.
source
share