ODP.NET and BOOLEAN Oracle Type

R

Robert Reineri

Using ODP.NET latest version - we have a stored proc that returns an Oracle
BOOLEAN type as an OUT parameter. I can't find anyting in the OracleDbType
enumeration that works - there is no Boolean there.

Any idea how to accomplish this? The docs don't even mention the BOOLEAN
type...

Of course, it's easy enough to change the SPROC to return something else,
like 1 or 0, but I think for what we're doing the BOOLEAN type just "feels"
better. I'm not a DBA though, just a poor coder - so I know just enough
about Oracle to be extremely dangerous :)

Thanks

Robert

P.S. Please respond to newsgroup. Thanks!
 
G

Guest

Robert,
I had this problem too, when interfacing with the Oracle HR system. I discussed it with some of the Oracle guys installing the system and they basicaly said tough luck, heres a version that returns 1/0 (as you suggested) so, unfortunately i think you are out of luck. Note that the MS data provider does not have an OracleType of 'Boolean', I am unsure of the Oracle or DataDirect ones however.

hth guy
 
F

Frans Bouma [C# MVP]

Robert said:
Using ODP.NET latest version - we have a stored proc that returns an Oracle
BOOLEAN type as an OUT parameter. I can't find anyting in the OracleDbType
enumeration that works - there is no Boolean there.

Any idea how to accomplish this? The docs don't even mention the BOOLEAN
type...

Of course, it's easy enough to change the SPROC to return something else,
like 1 or 0, but I think for what we're doing the BOOLEAN type just "feels"
better. I'm not a DBA though, just a poor coder - so I know just enough
about Oracle to be extremely dangerous :)

Isn't the BOOLEAN type an alias / UDT ? It's not a native Oracle type as far
as I know, as Oracle doesn't have a native boolean type. Most developers use
NUMBER(1) or CHAR(1) with 'Y' or 'N' for example.

Frans.
 
G

Guest

further to this Boolean is not a type in Oracle (so you can not store it in an Oracle table), just in PL/SQL, shame really!

guy
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

In the OracleClient space, there is a OracleBoolean type that I have used.
Not sure in ODP .NET, as I cannot install new software here at work and have
been unable to find time to play any more at home. I am not sure if ODP .NET
is compatible with the OracleClient types; knowing the MS/Oracle animosity,
I doubt it.

Frankly, getting MS to talk to Oracle is a bit of a pain, but a pain one
must go through if their server is Oracle. The use of REF_CURSORS for result
sets adds a bit more programming on the poor devs' shoulders.

I have created a generic data layer, extending the Microsoft Data Access
Application Block, that uses OracleClient, OleDb and SqlClient. One day, I
will play with ODP, but not sure when.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 

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