SQL:缺少右括号 [英] SQL: Missing right parenthesis
问题描述
在创建新的Oracle表时遇到很多问题.它已从一个错误变为另一个错误.
I have been having a lot of problems in creating a new Oracle table. It has gone from one error to another.
这可能是它的最后一个问题.
This may be its last issue.
我正在尝试为什么此表给出错误ORA-00907:缺少右括号:
I am trying out why this table is giving the error ORA-00907: missing right parenthesis:
CREATE TABLE rental
( rental_id CHAR(8)
, overdue_cost INTEGER(10,2)
, days_checked_out INTEGER(10,0)
)
推荐答案
Oracle INTEGER
类型不允许precision
或scale
.
实际上,Oracle的INTEGER
与NUMBER(38, 0)
基本上相同.
Oracle INTEGER
type does not allow either precision
nor scale
.
Actually, Oracle's INTEGER
is basically the same as NUMBER(38, 0)
.
根据您的情况,您可以通过两种方式更改overdue_cost
和days_checked_out
的定义:
In your case you can change the definition of overdue_cost
and days_checked_out
in two ways:
-
将它们定义为
INTEGERS
,但将presision
/scale
留在外面:
overdue_cost INTEGER,
days_checked_out INTEGER
将它们定义为NUMBER(10, 0)
-首选,因为其中一个字段具有非零的scale
.
Define them as NUMBER(10, 0)
- preferred, since one of the fields has non-zero scale
.
overdue_cost NUMBER(10, 0),
days_checked_out NUMBER(10, 2)
这篇关于SQL:缺少右括号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!