locked
Using ODAC in WebApplication RRS feed

  • Question

  • hello people.

     

    I've a problem.

    I use an oracle driver "ODAC" in my proyect, I have a Stored procedure (SP) in Oracle package , this SP have a four parameter: 3 imput parameters and 1 output parameter.

    the imput parameters are : Name varchar2, rut varchar2 and listanueva as type arraysampleid is VARRAY(200) of NUMBER;

     

    my code:

    when I run this, I get an error: Invalid parameter binding\r\nParameter :"listanueva"

     

        using (OracleConnection conn = new OracleConnection("User Id=user;Password=pass;Data Source=ORCL"))
        {
         conn.Open();
         
         
         OracleCommand command = conn.CreateCommand();
         command.CommandType = CommandType.StoredProcedure;
    
         command.CommandText = "INFO_DATOSPERSONA_5.ObtenerDatosPersona";
         command.Parameters.Add("listanueva", OracleDbType.Array , idPersonas, ParameterDirection.Input);
         //command.Parameters["listanueva"].CollectionType = OracleCollectionType.PLSQLAssociativeArray;
    
         command.Parameters.Add("Nombre", OracleDbType.Varchar2, "Texto", ParameterDirection.Input);
         command.Parameters.Add("rut", OracleDbType.Varchar2, "19", ParameterDirection.Input);
    
         command.Parameters.Add("CursorDatosPersona", OracleDbType.RefCursor, ParameterDirection.Output);
    
         OracleDataReader reader = command.ExecuteReader();
         while (reader.Read())
         {
          var dd = reader;
         }
    
         reader.Close();
         conn.Close();     
        }
    

     

    in my oracle SP:

     

    Package:

     

     

    create or replace package INFO_DATOSPERSONA_5 AS
     TYPE rtnCursor IS REF CURSOR;
    
     type arraysampleid is VARRAY(200) of NUMBER; -- arreglo de enteros 
     PROCEDURE ObtenerDatosPersona(CursorDatosPersona OUT rtnCursor,
            listanueva   arraysampleid,
            Nombre in VARCHAR2,
            Rut  in varchar2);
    
    end INFO_DATOSPERSONA_5;
    

    My SP:

     

    create or replace package body INFO_DATOSPERSONA_5 AS
    
     PROCEDURE ObtenerDatosPersona
     (
      CursorDatosPersona OUT rtnCursor,
      listanueva arraysampleid,
      Nombre in varchar2,
      Rut in varchar2
     ) AS
    
    .
    .
    .
    .
    .
    

     

     

    by, an thanks for your replies.

     

    sorry if this is not going here.

     

     


    Soy arcenett
    • Edited by arcenett Wednesday, April 27, 2011 9:40 PM pass
    • Moved by Leo Liu - MSFT Wednesday, May 4, 2011 6:03 AM Off Topic (From:Visual C# General)
    Wednesday, April 27, 2011 9:40 PM

All replies