开发者

Boolean data type size and want to print its value?

I want to know size of data type boolean , i used VSIZE() functio开发者_如何转开发n 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;


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.


How to use BOOLEAN type in SELECT statement

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜