0

오류 메시지 : 저장소 데이터 공급자가 반환 한 데이터 판독기에 요청한 쿼리의 열이 충분하지 않습니다.엔터티 프레임 워크 프로 시저 오류 - Silverlight, EF, Oracle

public ObjectResult<global::System.String> P_GET_MST_CODE(global::System.String i_RES_TYPE, ObjectParameter v_RESULT) 
{ 
    ObjectParameter i_RES_TYPEParameter; 
    if (i_RES_TYPE != null) 
    { 
     i_RES_TYPEParameter = new ObjectParameter("I_RES_TYPE", i_RES_TYPE); 
    } 
    else 
    { 
     i_RES_TYPEParameter = new ObjectParameter("I_RES_TYPE", typeof(global::System.String)); 
    } 

    return base.ExecuteFunction<global::System.String>("P_GET_MST_CODE", i_RES_TYPEParameter, v_RESULT); 
} 

아래는 저장 프로 시저의 정의입니다.

<Function Name="P_GET_MST_CODE" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="LEGACY"> 
    <Parameter Name="I_RES_TYPE" Type="varchar2" Mode="In" /> 
    <Parameter Name="V_RESULT" Type="varchar2" Mode="Out" /> 
</Function> 

누구든지이 문제를 해결할 수 있습니까?

답변

0

필자는 엔티티 연결 개체를 피함으로써이를 해결했습니다. :-)

지금까지는 ORACLE Database의 OUT 매개 변수에 대해 지원되지 않는 것으로 보입니다.

다음은 변경된 코드 예제입니다.

using System.Data; 
using System.Data.Common; 
using System.Data.EntityClient; 
using System.ServiceModel.DomainServices.EntityFramework; 
using System.ServiceModel.DomainServices.Server; 
using Oracle.DataAccess.Client; 

....... 

[Invoke] 
public string method(string OTL) 
{ 
    DbCommand cmd = (((EntityConnection)this.ObjectContext.Connection).StoreConnection).CreateCommand(); 
    cmd.CommandType = System.Data.CommandType.StoredProcedure; 
    cmd.CommandText = "LoveMe"; 

    OracleParameter ep = new OracleParameter("I_RES_TYPE", OTL); 
    ep.OracleDbType = OracleDbType.Varchar2; 
    ep.Direction = ParameterDirection.Input; 

    OracleParameter epV_RESULT = new OracleParameter("V_RESULT", null); 
    epV_RESULT.OracleDbType = OracleDbType.Varchar2; 
    epV_RESULT.Size = 30; 
    epV_RESULT.Direction = ParameterDirection.Output; 

    cmd.Parameters.Add(ep); 
    cmd.Parameters.Add(epV_RESULT); 

    cmd.Connection.Open(); 
    cmd.ExecuteNonQuery(); 

    string result = cmd.Parameters[1].Value.ToString(); //What I want to get. 

    cmd.Connection.Close(); 

    return result; 
} 
관련 문제