Oracle数据库中是否有任何布尔类型? [英] Is there any boolean type in Oracle databases?
问题描述
Oracle数据库中是否有任何布尔类型,类似于Ms SQL Server中的BIT
数据类型?
Is there any Boolean type in Oracle databases, similar to the BIT
datatype in Ms SQL Server?
推荐答案
不仅在Oracle的SQL(不是PL/SQL)中缺少布尔数据类型,而且对于使用什么,他们也没有明确的建议.参见此线程在Asktom上.当有人指出'Y'/'N'
取决于英语时,他们从推荐CHAR(1) 'Y'/'N'
切换到NUMBER(1) 0/1
.德国程序员可能改用'J'/'N'
.
Not only is the boolean datatype missing in Oracle's SQL (not PL/SQL), but they also have no clear recommendation about what to use instead. See this thread on asktom. From recommending CHAR(1) 'Y'/'N'
they switch to NUMBER(1) 0/1
when someone points out that 'Y'/'N'
depends on the English language, while e.g. German programmers might use 'J'/'N'
instead.
最糟糕的是,他们捍卫这个愚蠢的决定,就像捍卫''=NULL
愚蠢一样.
The worst thing is that they defend this stupid decision just like they defend the ''=NULL
stupidity.
这篇关于Oracle数据库中是否有任何布尔类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!