How to call oracle function to get returned boolean type

G

Guest

My application needs to call Oracle function using oracle client 9.2. The
oracle function returns boolean value from its returned parameter. The name
space that I used is system.data.oracleclient. found out there is no boolean
type in Oracle parameter in OracleType. How can I get the returned value from
function call in my code?

Thanks in advance
 
F

Frans Bouma [C# MVP]

John said:
My application needs to call Oracle function using oracle client 9.2.
The oracle function returns boolean value from its returned
parameter. The name space that I used is system.data.oracleclient.
found out there is no boolean type in Oracle parameter in OracleType.
How can I get the returned value from function call in my code?

Thanks in advance

Isn't BOOLEAN a synonym type for NUMBER(1,0) ? Oracle doesn't have a
native boolean type, hence my question.

Use oraclecommand.ExecuteScalar, which returns an object. THen in the
debugger examine what the type is. 10 to 1 it's a numeric value, and
because you're using the MS oracle provider, it's likely to be a
decimal.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
G

Guest

Frans,
Thanks for your recommendation. However, this does not work becuase
executeScalar got exception so could not inspect the return. I tried to use
OLE provider which has boolean type but I got exception "ORA-06550: line 1,
column 27:
PLS-00306: wrong number or types of arguments in call to 'AVAILABLE_INVENTORY'
ORA-06550: line 1, column 7:
". It may be becuase of Oracle boolean type has three value (True, false and
nulll) but OLE has only two (True and false). I have no clue how to deal with
this.

Someone can help?

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