I got the function that returns me a varchar2
.
I'm using dapper and I got a problem while executing this query.
OracleDynamicParameters DictionaryParams = new OracleDynamicParameters();
DictionaryParams.Add(name: "id", value: id,direction: ParameterDirection.Input);
DictionaryParams.Add(name: "Return_Value",oracleDbType: OracleDbType.Varchar2,direction: ParameterDirection.ReturnValue);
con.Execute("function_name", DictionaryParams, commandType: CommandType.StoredProcedure);
string a;
a = DictionaryParams.Get<string>("Return_Value");
And I got an Oracle error:
ORA-06502: PL/SQL: error number or value :character string buffer too small
I tried to give a size to a returning value but this didn't work, and I also tried to figure out but everything didn't worked.
Can someone take a look at this?
You need to specify the max size of the varchar2.
Example:
parameters.Add("P_OUTPUT", dbType: OracleDbType.Varchar2, direction: ParameterDirection.Output, size: 1000);