OUT NUMBER Parameters with Microsoft OLE DB Provider for Oracle =>OCI-22060

  • Thread starter Holger (David) Wagner
  • Start date
H

Holger (David) Wagner

Hi Group,

we're experiencing a very weird problem with the Microsoft OLE DB
Provider for Oracle. We're using the version shipped with Visual
Studio.NEt 2003.

When we have any OUT parameter of type NUMBER, we get OCI-22060
(Argument [2] ist eine ungültige oder nicht initialisierte Zahl). This
also happens when calling a function, where RETURN_VALUE is declared as
NUMBER.

OUT parameters as VARCHAR2 work fine, whenever we switch to NUMBER, the
problem occurs.

We're simply drag'n'dropping the command (stored procedure) from the
server explorer. Could it be we're doing anything wrong?

Or is this a bug in the provider? If so, are there any workaround or
fixes available?

regards,
david
--
Auch das geht vorüber. (Sufi-Weisheit)

Holger (David) Wagner Tel: +49 (89) 890 50 962
Dewetstrasse 1 Mobil: +49 (177) 274 12 45
D-80807 München Fax: +49 (177) 992741245
 
M

Miha Markic

Hi Holger,

Try this parameter declaration:
new System.Data.OracleClient.OracleParameter("ColumnName",
System.Data.OracleClient.OracleType.Number, 22,
System.Data.ParameterDirection.Output, false, ((System.Byte)(0)),
((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null);

Does it work?
 
H

Holger (David) Wagner

Hi Miha,

Miha said:
Try this parameter declaration:
new System.Data.OracleClient.OracleParameter("ColumnName",
System.Data.OracleClient.OracleType.Number, 22,
System.Data.ParameterDirection.Output, false, ((System.Byte)(0)),
((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null);

Does it work?

Thanks for the tip! It does not work - using this parameter declaration,
I get an exception indicating that the parameter is of the wrong type.
However, after trying it with your parameter declaration, I tried the
original declaration again (System.Data.ParameterDirection.ReturnValue
instead of System.Data.ParameterDirection.Output)...

.... and it worked!!!

The problem was within the Stored Procedure itself. Only that using the
VARCHAR return type, null could be returned - with the NUMBER return
type, it seems that null could not be returned (which comes not as
surprise ;-) ).

After fixing the stored procedure with the VARCHAR return type, it now
also works with the NUMBER return type. Without your posting, we not
have realized that, though ;-)

regards,
david
 

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