2 Replies Latest reply: Apr 15, 2012 10:51 PM by 930800 RSS

    How to Access the Return Value of a Function

    MikeB
      Hi,

      How do I access the return value when calling an Oracle function from .NET using Oracle.DataAccess.Client? The function returns an integer of 0, 1 or 99.

      Dim db_command_oracle As New OracleCommand()
      db_command_oracle.Connection = db_connection_oracle
      db_command_oracle.CommandType = CommandType.StoredProcedure
      db_command_oracle.CommandText = "swsarsi.import_appointments"

      Dim ret_value As New OracleParameter()
      ret_value.OracleDbType = OracleDbType.Int32
      ret_value.Direction = ParameterDirection.ReturnValue
      ret_value.Size = 2
      ret_value.OracleDbType = OracleDbType.Int32
      db_command_oracle.Parameters.Add(ret_value)

      Dim IN_student_id As New OracleParameter()
      IN_student_id.OracleDbType = OracleDbType.Varchar2
      IN_student_id.Direction = ParameterDirection.Input
      IN_student_id.Size = 10
      IN_student_id.Value = student_id
      db_command_oracle.Parameters.Add(IN_student_id)

      db_command_oracle.ExecuteNonQuery()

      messagebox.show(ret_value) ?????