布尔数据类型的大小并想打印它的值?
我想知道数据类型布尔值的大小,我使用了VSIZE()函数,但它不适用于布尔值 > 和 想要打印布尔值并将其存储到表中。 请让我知道oracle如何存储布尔值,是否有其他方法查看数据类型 和布尔变量的值。 至少告诉我布尔值的大小
当我在 vsize() 中使用布尔值时出现此错误
错误“表达式类型错误”
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;
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;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SQL 标准没有 BOOLEAN 数据类型,Oracle 也不支持这种类型。这就是
VSIZE()
抛出异常的原因。在 PL/SQL 中,布尔值被实现为枚举,这很有趣,因为 PL/SQL 不支持枚举。然而,构成 PL/SQL 基础的 ADA 语言却可以。皮特·芬尼根 (Pete Finnegan) 写了更多相关内容; 查看一下。
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.
如何在 SELECT 语句中使用 BOOLEAN 类型
我不能说我对这种情况有第一手的了解,但我认为这里使用
CASE
就是您正在寻找的解决方案。http://www.oracle.com/技术/sample_code/tech/pl_sql/htdocs/x/Case/start.htm
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