[Q] Reading BOOLEAN return value from Oracle function

  • Thread starter João Pedro Martins
  • Start date
J

João Pedro Martins

Hello,

Can anyone tell me how to retrieve a boolean return value from an Oracle
Function,
using MS .Net Framework Data Provider for Oracle?

In the documentation there's a "Mapping Data Types" table that shows which
Oracle data types correspond to which .Net types (OracleType.xxx), but
Boolean is omitted...

My code is like this:

.... other parameters...
oracleCommand.Parameters.Add("O_retval",OracleType.XXXXX).Direction =
ParameterDirection.ReturnValue;
.....

what do use in place of the XXXXX when the Oracle function returns a
BOOLEAN?

Any help would be greatly apreciated.

Thanks in advance,
Joao Martins
 
J

Joe Fallon

It is news to me that Oracle tables support a Boolean datatype.
When did that happen?
I use 9i and treat the field as numeric 0 or 1.
 
J

João Pedro Martins

Joe Fallon said:
It is news to me that Oracle tables support a Boolean datatype.
When did that happen?
I use 9i and treat the field as numeric 0 or 1.

Oracle tables do not support Boolean, but Oracle PL/SQL functions do, for
example as return values... that's my problem.

j
 
P

Paul Clement

¤ Hello,
¤
¤ Can anyone tell me how to retrieve a boolean return value from an Oracle
¤ Function,
¤ using MS .Net Framework Data Provider for Oracle?
¤
¤ In the documentation there's a "Mapping Data Types" table that shows which
¤ Oracle data types correspond to which .Net types (OracleType.xxx), but
¤ Boolean is omitted...
¤
¤ My code is like this:
¤
¤ ... other parameters...
¤ oracleCommand.Parameters.Add("O_retval",OracleType.XXXXX).Direction =
¤ ParameterDirection.ReturnValue;
¤ ....
¤
¤ what do use in place of the XXXXX when the Oracle function returns a
¤ BOOLEAN?
¤

Only Oracle database data types are supported, not PL/SQL. You will need to use something else (such
as varchar) to return the value (as an output parameter) of your PL/SQL boolean.

CREATE OR REPLACE PROCEDURE TESTPARAM1 (
RET_Result OUT VARCHAR
)
AS
BEGIN
RET_Result := 'True';
END;


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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