开发者

Oracle create table not working when executed from SQL Script

I have a create table statement on a Oracle Script file and when I executed the script file, I am unable to create the table.

Content of script file

-- Table Creation Script

CREATE TABLE SampleTable
(

FIELD1 NUMBER NOT NULL,
FIELD2 DATE NULL,
FIELD3 DATE DEFAULT SYS开发者_开发技巧DATE,
FIELD4 DATE NULL,
FIELD5 NUMBER(10) DEFAULT 1,
FIELD5 NUMBER(10) NULL,
FIELD6 VARCHAR2(1000) NULL
);

I am getting a SP2-0734: error. Any ideas?


Two things:

One - remove that carriage return between ( and FIELD1

Two - there are two FIELD5 entries, giving the result ORA-00957: duplicate column name

Here:

CREATE TABLE SampleTable
(
FIELD1 NUMBER NOT NULL,
FIELD2 DATE NULL,
FIELD3 DATE DEFAULT SYSDATE,
FIELD4 DATE NULL,
FIELD5 NUMBER(10) DEFAULT 1,
FIELD6 NUMBER(10) NULL,
FIELD7 VARCHAR2(1000) NULL
);


The following link has several promising answers that may resolve your problem.

http://arjudba.blogspot.com/2010/01/sp2-0734-unknown-command-beginning-rest.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜