How to use OleDbCommand and OleDbPameter for Oracle Stored Procedure

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top