oracle 错误码907,ora-907错误,如何解决,请高手指点!

当CREATE TABLE脚本包含'--comments'时,Oracle导入会出现ORA-00907错误。此问题在7.1到7.3及更早版本中可复现。解决方案包括修改CREATE TABLE脚本中的注释或使用/**/注释替换--注释,确保所有括号成对出现,以避免导入失败。
摘要由CSDN通过智能技术生成

From Metalink:

Problem Description

===================

Import fails with an ORA-00907 error.

ORA-00907: "missing right parenthesis"

Cause: A left parenthesis has been entered without a closing right

parenthesis, or extra information was contained in the

parentheses. All parentheses must be entered in paris.

Action: Correct the syntax and retry the statement.

Problem Explanation

===================

If the create table script includes "-- comments", the import of the table will

fail with an ORA-00907 error.

This problem is reproducible in version 7.1, 7.2, 7.3, and pre-8.0.4.

Example:

--------

1. create table TEST ( field1 varchar2(30) default 'TEST'

-- HALLO

-- Comment

,field2 varchar2(30) default 'TEST'

);

2. Export the table.

3. The import of the table will fail with an ORA-00907.

Search Words:

=============

comment comments export import

ORA-907

Solution Description:

=====================

Remove or modify the comments from CREATE TABLE scripts.

Solution Explanation:

=====================

After running the example script from the Problem Explanation, in the columns

data_default of table dbs_tab_columns, the following information is stored:

'TEST'    -- HALLO --COMMENT.

Inserting data doesn't cause any problems. But if you export the table, the

content of this row is exported. The import afterwards cannot create the table,

because the default value and the comment are now on the same line.  This means

characters after "--" are comment and not defined.

The following workarounds for the comments defined in CREATE TABLE will allow

successful export/import:

1. If the script is sligthly modified, moving the "," in front of comment

lines will allow the import to work correctly.  Comments are not stored.

create table TEST ( field1 varchar2(30) default 'TEST',

-- HALLO

-- Comment

field2 varchar2(30) default 'TEST'

);

- OR -

2.  Replace all -- comments with /* */ comments.  For example:

create table TEST ( field1 varchar2(30) default 'TEST'

/* HALLO */

/* Comment */

,field2 varchar2(30) default 'TEST'

);

Solution References:

====================

[BUG:334685]  COMMENTS ARE STORED IN DBA_TAB_COLUMNS.DATA_DEFAULT

Fixed In release 8.0.4.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值