Calling Oracle Stored Functions from vb.net

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: rishaan (rachna21_at_gmail-dot-com.no-spam.invalid)
Date: 12/17/04


Date: 17 Dec 2004 09:59:03 -0600

I am trying to call a stored function of Oracle Package from VB.net.
The function takes a string and returns boolean.
How should I call it from vb.net ?
I tried 3 different ways but get error:

ORA-06550:PLS-00221:StoredFunctionNAme is not a procedure or is
undefined.:PL/SQL:statement ignored.

I also tried "select StoredFunctionName(' " & saha & "') from
dual"
but Oracle does not allow boolean values in SQL.

the code:

  Dim connection As OracleConnection = Nothing
        Dim command As OracleCommand = Nothing
        connection = New OracleConnection(ConnString)
            command.CommandType = CommandType.StoredProcedure
            Dim paraName As New OracleParameter("StoredFunctionNAme",
OracleType.VarChar)
            paraName.Direction = ParameterDirection.Input
            paraName.Value = Name
                     
            command.Parameters.Add(paraName)
            connection.Open()
            Dim MyDA As New OracleDataAdapter(command)
            Dim ds As New DataSet
            Try

(1) MyDA.Fill(ds)

                Dim rowid As OracleString
 (2) Dim bb As Boolean =
Convert.ToBoolean(command.ExecuteOracleNonQuery(rowid))

   (3) Dim bb1 As Boolean =
Convert.ToBoolean(command.ExecuteNonQuery())
            Catch x As Exception
                MessageBox.Show(x.Message.ToString)
            End Try

*-----------------------*
        Posted at:
  www.GroupSrv.com
*-----------------------*



Relevant Pages

  • Re: Intermittent problem in data transfer MSAccess to Oracle using VB
    ... It retrieves data from a MSAccess database and writes to an Oracle ... Dim LogFileName As String, ff As Long, QueryName As String ... Dim MSAccessConn As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Query Oracle from Excel
    ... You will need the Oracle client sofware installed on the PC you're running ... What exactly is DBDataProvider and DBDataSource? ... Global prmUsername As String ... Dim adoConn As New ADODB.Connection ...
    (microsoft.public.excel.programming)
  • RE: Query Oracle from Excel
    ... Ron, thanks for your help...this is REALLY helping me!!!! ... Now, let's say that Oracle resides on the LAN/WAN somewhere, and I don't ... Global prmUsername As String ... Dim adoConn As New ADODB.Connection ...
    (microsoft.public.excel.programming)
  • Re: Storing time values via jdbc thin driver
    ... In Oracle you don't have just time anyway. ... Java knows Time and Date, ... There is a date data type which has a time ... string or character value. ...
    (comp.databases.oracle.server)
  • Re: Re-logging into An Oracle Database
    ... I've done it in MS SQL but never in Oracle. ... My connection string seems to work, but the app seems to keep the old userid so I can't see the tables I need to see. ... What I prefer to do is use PTQs is to run updates via VBA, something like this. ... 'no error handling included here for this post, but error procs can be included to return a false for this function of the query does not execute. ...
    (comp.databases.ms-access)