none
Problem while using OracleHelper.cs download from the MSDN RRS feed

  • Question

  • Im using OracleHelper to execute store procedure with 3 parameters but oracle Helper is giving error of parameter miss-match as it showing only 2 parameters but if I use this SP with non-OracleHelper code then it is working fine.

    Below mention method of OracleHelper is returning only 2 parameters but actually there is 3 parameters are define in required store procedure



    private
    static OracleParameter[] GetSpParameterSetInternal(OracleConnection connection, string spName, bool includeReturnValueParameter)

    {

     

    if( connection == null ) throw new ArgumentNullException( "connection" );

     

    if( spName == null || spName.Length == 0 ) throw new ArgumentNullException( "spName" );

     

    string hashKey = connection.ConnectionString + ":" + spName + (includeReturnValueParameter ? ":include ReturnValue Parameter":"");

     

    OracleParameter[] cachedParameters;

     

    cachedParameters = paramCache[hashKey]

    as OracleParameter[];

     

    if (cachedParameters == null)

    {

     

    OracleParameter[] spParameters = DiscoverSpParameterSet(connection, spName, includeReturnValueParameter);

    paramCache[hashKey] = spParameters;

    cachedParameters = spParameters;

    }

     

     

    return CloneParameters(cachedParameters); // HERE RETURNING TWO PARMS MISSING FIRST ONE

    }

    Procedure Body:

    CREATE

     

    OR REPLACE procedure usp_Client(pin_ClientName in varchar2, pin_Manager in varchar, pout_IsDuplicate out number)

    is

    tempInt

    number(1);

    begin

     

    select

     

    count(*) into tempInt from tblPMClient where Client_Name= pin_ClientName;

    IF

     

    tempInt > 0 THEN

    pout_IsDuplicate

    := 1;

     

     

    ELSE

    BEGIN

    insert

     

    into tblPMClient values(INTRANET.SEQ_PM_CLID.Nextval, pin_ClientName, pin_Manager, 'Admin', sysdate);

    pout_IsDuplicate

    := 0;

    END;

    End

     

    IF;

    end

     

    usp_Client;

    /

    Thursday, December 3, 2009 8:58 AM