Home » Infrastructure » Windows » How to return a TABLE datatype using ADODB (Windows, Oracle 8i)
How to return a TABLE datatype using ADODB [message #393202] Fri, 20 March 2009 13:28
Jaime Stuardo
Messages: 57
Registered: March 2004
Member
Hello, I have an Oracle stored procedure that returns a TABLE type defined as follows:

TYPE dataChunks IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER;


The TABLE is filled correctly, as I tested it using DBMS_OUTPUT.PUT_LINE instruction.

The procedure that fills it is defined as:

  PROCEDURE SP_OBTIENE_DATOS_CSV ( v_opcion IN VARCHAR2, v_moneda IN VARCHAR2, v_rut_corredor IN NUMBER, 
                                   v_periodo_desde IN DATE, v_periodo_hasta IN DATE,
                                   v_poliza IN NUMBER, v_data OUT dataChunks );


Well... and this is the calling procedure in ASP, using MSDAORA provider:

        Dim oConn, oCmd, oRs
        Set oConn = Server.CreateObject("ADODB.Connection")
        oConn.Open "Provider=MSDAORA;Password=blablabla;User ID=blablabla;Data Source=blablabla;"
        Set oCmd = Server.CreateObject("ADODB.Command")
        With oCmd
          .ActiveConnection = oConn
          .CommandType = 1
          .CommandText = "{ call PKG_EVOLUCION.SP_OBTIENE_DATOS_CSV ( ?, ?, " & _
                                                                     "?, ?, " & _
                                                                     "?, ?, {resultset 10000, v_data} ) }"
          .Parameters.Append .CreateParameter("v_opcion", 200, 1, Len(sInforme), sInforme)
          .Parameters.Append .CreateParameter("v_moneda", 200, 1, Len(sMoneda), sMoneda)
          .Parameters.Append .CreateParameter("v_rut_corredor", 131, 1, , iCorredor)
          .Parameters.Append .CreateParameter("v_periodo_desde", 7, 1, , DateSerial(Left(sPeriodoDesde, 4), Mid(sPeriodoDesde, 5, 2), "01"))
          .Parameters.Append .CreateParameter("v_periodo_hasta", 7, 1, , DateSerial(Left(sPeriodoHasta, 4), Mid(sPeriodoHasta, 5, 2), "01"))
          .Parameters.Append .CreateParameter("v_poliza", 131, 1, , sPoliza)
          Set oRs = .Execute
          oRs.Close          
          Set oRs = Nothing
        End With
        oConn.Close
        Set oConn = Nothing


The error I'm receiving in .Execute method is:

ORA-02005: implicit (-1) length not valid for this bind or define datatype


Any help will be greatly appreciated
Thanks

Jaime
Previous Topic: Auto backup
Next Topic: Can't Install any Oracle successfully!!
Goto Forum:
  


Current Time: Thu Aug 21 19:01:30 CDT 2014

Total time taken to generate the page: 0.09228 seconds