Forum Stats

  • 3,767,817 Users
  • 2,252,720 Discussions
  • 7,874,336 Comments

Discussions

How to call an Stored procedured with out table

2955411
2955411 Member Posts: 1
edited May 27, 2015 11:35AM in .NET Stored Procedures

Hi

I need to call a Stored Procedure  that have in and out parameters but I cant find where is the error:

the store procedure

  PROCEDURE proc(pNumber       IN VARCHAR2,
                       pTable     OUT tCliente,
                       Existe        OUT BOOLEAN) IS
  CURSOR cGetCustomer(prm_nudocu IN DocCustomer.nudocu%Type) IS
    SELECT nuclie    FROM  DocCustomer WHERE cddocu = 'CI' AND nudocu = prm_nudocu
     ORDER BY nuclie;
  vnuclie Customer.nuclie%Type;
  vIndice BINARY_INTEGER := 0;
  BEGIN
    Existe := FALSE;
    FOR k IN cGetCustomer(pNumber) LOOP
      pTable(vIndice).RNuCust := k.nuclie;
      pTable(vIndice).RName := k.name;
      vIndice := vIndice + 1;
      Existe := TRUE;
    END LOOP;
  END proc;

my c# code is:

OracleCommand cmd = GetCommand("pq.Proc");

            cmd.CommandType = System.Data.CommandType.StoredProcedure;

           OracleParameter p1= cmd.Parameters.Add("pNumber", OracleDbType.Varchar2, CI, ParameterDirection.Input);

           OracleParameter p2= cmd.Parameters.Add("pTable", OracleDbType.RefCursor,ParameterDirection.ReturnValue);

           OracleParameter p3= cmd.Parameters.Add("Existe", OracleDbType.Boolean,ParameterDirection.ReturnValue);

cmd.Connection.Open();

dr = cmd.ExecuteReader();  <====  the exception  is  here

The exception says: ORA-03115: unsupported network datatype or representation

Any Idea ?

THANKS IN ADVANCE

Answers

This discussion has been closed.