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

Home -> Community -> Usenet -> c.d.o.tools -> PL/SQL function return value problem

PL/SQL function return value problem

From: Gennady <gennadyb_at_halcosoftware.com>
Date: 2000/07/05
Message-ID: <3963604f$0$5560@fountain.mindlink.net>#1/1

Hello,
I created a stored function which returns a number. When I execute the function as PL/SQL block the returned number is non-zero value.
But when I tried to call the function from my Visual Basic application using Oracle Objects for OLE like this:

Dim diff_count as Integer

objDataBase.Parameters.Add "tname", "Mytable", ORAPARM_INPUT
objDataBase.Parameters("tname").ServerType = 1
objDataBase.Parameters.Add "diff_count", 3, ORAPARM_OUTPUT
objDataBase.Parameters("diff_count").ServerType = 2
Set PlSqlStmt = Nothing
Set PlSqlStmt = objDataBase.CreateSql("Begin :diff_count:=MY_FUNCTION(:tname);end;", 0&) diff_count = objDataBase.Parameters("diff_count").Value objDatabase.Parameters.Remove "tname"
objDatabase.Parameters.Remove "diff_count"

In this case MY_FUNCTION returns 0 every time, so diff_count = 0 . I think something wrong with passing output parameter back from Oracle to vb application.
Could you give me a hint how to fix the problem? Thanks,
Gennady Received on Wed Jul 05 2000 - 00:00:00 CDT

Original text of this message

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