Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error getting return value from function

436168Jan 11 2005 — edited Jan 14 2005
Hello

I'm getting a error calling a function with ODP.NET from C#

Code:
---------------------------------------------------------

OracleCommand oraCom = new OracleCommand("NORMALIZACION.nif",oraCon);
oraCom.CommandType = CommandType.StoredProcedure;

OracleParameter param1 = new OracleParameter("numnif",OracleDbType.Varchar2);
param1.Value= "73667866A";
param1.Direction = ParameterDirection.Input;

OracleParameter param2 = new OracleParameter("nif",OracleDbType.Varchar2);
param2.Size = 10; //FIXME line
param2.Direction = ParameterDirection.ReturnValue;

oraCom.Parameters.Add(param1);
oraCom.Parameters.Add(param2);

oraCom.ExecuteNonQuery();

nif_norm = oraCom.Parameters["nif"].Value.ToString();

---------------------------------------------------------

if i write the FIXME line i get a error (ORA-06502) complaining about the size, no matter the value i wrote.
If i don't write the FIXME line, it works but nif_norm is always empty, although the function i call is a single return 'Hello';

Where am I wrong??
Any help, examples with varchar2 as return value???

BTW: the same code with the MS provider for Oracle works fine.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2005
Added on Jan 11 2005
8 comments
2,591 views