Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> input/output parameter: howto get the output from VB6

input/output parameter: howto get the output from VB6

From: carl <carlogol_at_virgilio.it>
Date: 19 May 2005 06:16:36 -0700
Message-ID: <1116508596.699148.189800@z14g2000cwz.googlegroups.com>


Hi all

first of all, my apologies if this is off-topic. If so, please tell me where should I post it...

then, my problem

I have a COM+ written in VB6 which has to access an Oracle database (9.2). I *MUST* use ORAOLEDB provider.
A method in this COM+ dll has to call an Oracle Stored procedure which has several input parameter, some output parameter and also an input/output parameter (its type is NUMBER)

The thing is: I can get the output parameter just fine, but I have problems getting the correct value for the IN/OUT param. The stored procedures completes without problems, and it does exactly what it has to do, and it should really return me the correct value of this parameter. I tell this because from PL/SQL I can see with a dbms_output the returned value and it is correct. But when it comes to VB, it gets... truncated!

For example, I know the SP should return 145 (that's what it saves in the db), but in VB I can only see 14!
Can somebody help me, please?

Here's a sample of the code

PROCEDURE P(P1 IN VARCHAR2, P2 IN NUMBER, ...  PN1 OUT NUMBER, PN2 OUT NUMBER, ..., PINOUT INOUT NUMBER) IS ...

and the VB is something like



Dim oCmd as New adodb.Command
With oCmd
.CommandText = "{call p(?,?,....?)"

  Set oPar = .CreateParameter("P1", adBSTR, adParamInput, , P1)
.Parameters.Append oPar
...

  Set oPar = .CreateParameter("PN1", adNumeric, adParamOutput)
.Parameters.Append oPar
...

  Set oPar = .CreateParameter("PINOUT", adNumeric, adParamInputOutput, 10, -1)
.Parameters.Append oPar

.ActiveConnection = myORAOLEDBConn

  oRS.CursorLocation = adUseClient
  oRS.Open oCmd, , adOpenStatic, adLockReadOnly End With
'read in/out par
myInOutPar = oCmd.Parameters("PINOUT").Value


And instead of receiving 145 I only get 14 ;(

What am I missing?
Thanks in advance

Carlo Received on Thu May 19 2005 - 08:16:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US