[Q] Reading BOOLEAN return value from Oracle function

  • Thread starter Thread starter João Pedro Martins
  • Start date 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
 
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.
 
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
 
¤ 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)
 
Back
Top