Re: how to call an oracle function
- From: "Bjorn Abelli" <bjorn_abelli@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 2 Jun 2005 18:43:26 +0200
"Newbie" wrote...
> already tried changing OracleDbType.Int32 to OracleType.Int32
> but still getting the same exception
Did you name the parameters?
What is the *real* name of the input parameter?
Did you use that name?
Are there *more* parameters in the stored function than the input parameter
and the return value?
Did you get the "no length on String" error, even when you used
OracleType.Int32?
>> OracleCommand cmd = new OracleCommand();
>> cmd.Connection = oraConn;
>> cmd.CommandText = "ops$sqltime.pa_new_job_no_fn";
>> cmd.CommandType = CommandType.StoredProcedure;
>>
>> OracleParameter par1 =
>> new OracleParameter("RETURN_VALUE", OracleType.Int32);
>> par1.Direction = ParameterDirection.ReturnValue;
>> cmd.Parameters.Add(par1);
>>
>> // It's best to check what the input parameter *really* is
>> // named in the stored function, and to use that name...
>>
>> par1 = new OracleParameter("PROJECT_NO", OracleType.Int32);
>> par1.Value = projectNo;
>> par1.Direction = ParameterDirection.Input;
>> cmd.Parameters.Add(par1);
>>
>> int affectedRows = (int) cmd.ExecuteNonQuery();
>>
>> ljn = (int) cmd.Parameters["RETURN_VALUE"].Value;
// Bjorn A
.
- Follow-Ups:
- Re: how to call an oracle function
- From: Newbie
- Re: how to call an oracle function
- References:
- Re: how to call an oracle function
- From: Newbie
- Re: how to call an oracle function
- From: Bjorn Abelli
- Re: how to call an oracle function
- From: Newbie
- Re: how to call an oracle function
- Prev by Date: What are some design patterns that can be used with a tree control?
- Next by Date: Windows Messages....
- Previous by thread: Re: how to call an oracle function
- Next by thread: Re: how to call an oracle function
- Index(es):
Relevant Pages
|