views:

175

answers:

2

I want to know size of data type boolean , i used VSIZE() function but it is not working for boolean and Want to print and store boolean value into table. Please let me know how oracle store boolean value ,is there any other way to see data type and value for boolean variable. Atleast tell me size of boolean

i got this error when I used boolean in vsize()

ERROR " expression is of wrong type"

DECLARE
a boolean;
b number(7):=7;
c number(2):=2;
BEGIN
a:=b>c;
select vsize(a) into
b
from dual;
dbms_output.put_line(b);
END;
A: 

http://stackoverflow.com/questions/1465405/how-to-use-boolean-type-in-select-statement/1465432#1465432

I can't say I have first hand knowledge of this exact scenario, but I would picture use of CASE here to be the solution you're looking for. http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/x/Case/start.htm

KevenK
+1  A: 

The SQL standard does not have a BOOLEAN datatype and Oracle does not support one. That is why VSIZE()hurls the exception.

In PL/SQL boolean is implemented as an enumeration, which is interesting because PL/SQL doesn't support enumerations. However, ADA - the language which forms the basis for PL/SQL - does. Pete Finnegan wrote more about this; check it out.

APC