Oracle's lack of a Bit datatype for table columns

后端 未结 9 988
醉酒成梦
醉酒成梦 2021-02-05 03:13

Oracle does not support a bit datatype or any other type for true/false scenarios. Does one use the char(1) field instead by using a specific letter to

9条回答
  •  温柔的废话
    2021-02-05 03:58

    Use a CHAR(1), and a constraint to allow only 1 and 0.

    ...

    col CHAR(1),
    CONSTRAINT cons_atable_col1 CHECK (col1 IN ('1','0'))
    

提交回复
热议问题