[英]Oracle NUMBER(precision,scale) in HSQLDB
In a unit test I am trying to generate a table in an in-mem HSQLDB, the table contains a column with the definition: @Column(name = "xxx", columnDefinition="NUMBER(10,0) default 0")
. 在单元测试中,我试图在内存中的HSQLDB中生成一个表,该表包含一列,其定义为: @Column(name = "xxx", columnDefinition="NUMBER(10,0) default 0")
。 NUMBER is not recognized by HSQLDB (version 2.3.3), so I have added a script running this statement first: CREATE TYPE NUMBER AS NUMERIC;
HSQLDB(版本2.3.3)无法识别NUMBER,因此我添加了一个首先运行此语句的脚本: CREATE TYPE NUMBER AS NUMERIC;
. 。 Now it seems to recognize NUMBER, but I get the error unexpected token: (
instead. I cannot edit the column definition, so wow do I correctly map Oracle NUMBER(10,0)
to NUMERIC
? If I remove the precision and scale from NUMBER it seems to work. 现在它似乎可以识别NUMBER,但是我得到了错误的unexpected token: (
相反。我无法编辑列定义,所以哇,我可以正确地将Oracle NUMBER(10,0)
映射到NUMERIC
吗?如果我从NUMBER中删除精度和小数位数它似乎有效。
You do not need to define the NUMBER type, as it is supported by HSQLDB. 您不需要定义NUMBER类型,因为HSQLDB支持该类型。
HSQLDB supports Oracle syntax in one of its compatibility modes. HSQLDB以其兼容模式之一支持Oracle语法。 Run this statement to enable it: 运行以下语句将其启用:
SET DATABASE SQL SYNTAX ORA TRUE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.