How to use OleDbCommand and OleDbPameter for Oracle Stored Procedure

  • Thread starter Thread starter punkin
  • Start date Start date
P

punkin

Hi all,

The following is extracted from the code:

Dim cmd As OleDbCommand = New OleDbCommand()
cn.Open()
cmd.Connection = cn

cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "boy.savedata"
Dim param As OleDbParameter = cmd.Parameters.Add("xid",
OleDbType.VarNumeric)
param.value = xid
param = cmd.Parameters.Add("result", OleDbType.VarNumeric)
param.value = result
param = cmd.Parameters.Add("selected", OleDbType.VarNumeric)
param.value = selected
cmd.ExecuteNonQuery

The original stored procedure can be done in the SQL+ in the following
way:
exec boy.savedata( xid, result, selected )

I was trying to put @ in front of the parameter name but it doesn't
work either. Something like this:

param = cmd.Parameters.Add("@result", OleDbType.VarNumeric)

According to the following link:

http://groups.google.com/groups?hl=...te+oracle+stored+procedure&hl=en&lr=&ie=UTF-8

I should not proceed a "@" in front of the parameter name if the
database is Oracle. Unfortunately, both cases are not workable to me.
Nothing happens to the database after save. Is there anyone who can
give me some hint? Thanks.
 
Back
Top