SQL:缺少右括号 [英] SQL: Missing right parenthesis

查看:158
本文介绍了SQL:缺少右括号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建新的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类型不允许precisionscale.
实际上,Oracle的INTEGERNUMBER(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_costdays_checked_out的定义:

In your case you can change the definition of overdue_cost and days_checked_out in two ways:

  1. 将它们定义为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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆