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 -> Re: PL/SQL function return value problem

Re: PL/SQL function return value problem

From: Marc Melancon <mmelanco_at_sfi-software.com>
Date: 2000/07/05
Message-ID: <tnM85.1576$B4.66381@weber.videotron.net>#1/1

You can work around the problem my using a select to get the result:

select MY_FUNCTION(:tname) from dual

MarcM

"Gennady" <gennadyb_at_halcosoftware.com> wrote in message news:3963604f$0$5560_at_fountain.mindlink.net...
> 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