ORA-06502: PL/SQL: numeric or value error: character string buffer too small exception from C# code

前端 未结 6 2217
暖寄归人
暖寄归人 2021-02-20 03:33

I am trying to execute some oracle pl/sql procedure with in and out parameters from # code on asp.net. I want to retrive the value from out parameter. but when I execute i am ge

6条回答
  •  终归单人心
    2021-02-20 03:47

    Faced the same issue when declaring out put value as Varchar2. Adding a Size property to Parameter solved the issue.

    command.CommandType = CommandType.StoredProcedure;
    command.CommandText = "function_name";    
    command.Parameters.Add(new OracleParameter
                            {
                                ParameterName = "result",
                                Size = 1,
                                Direction = ParameterDirection.ReturnValue,
                                OracleDbType = OracleDbType.Varchar2
                            });
    

提交回复
热议问题