oracle sql自动取得注释,Oracle SQL Developer将我的注释视为命令

我已经创建了一些非常基本的sql脚本:

/*

Change date format

*/

alter session set nls_date_format='DD/MM/YYYY';

/*

Drop old tables (if exists)

*/

DROP TABLE Students;

/*

Create new tables

*/

CREATE TABLE Students

(

Id NUMBER(6) PRIMARY KEY,LastName VARCHAR2(20),FirstName VARCHAR2(10),Address VARCHAR2(10),BirthDay DATE,GroupId NUMBER(3)

);

/*

Check the table was created successfully

*/

DESC Students;

/*

Insert a new record to the table

*/

INSERT INTO Students VALUES(101,'Solin','Dan','Beer-Sheva','01/02/1985',11);

/*

Check the record was inserted succesfully

*/

SELECT * FROM Students;

/*

Add 'AvgMark' field to the table with default of 0

*/

ALTER TABLE Students ADD AvgMark NUMBER(5,2) DEFAULT 0;

/*

Check that the new field was added

*/

DESC Students;

/*

Insert 3 new records to the table

*/

INSERT INTO Students VALUES(102,'Tal','Ruti','Tel-Aviv','10/07/1988',12,70);

INSERT INTO Students VALUES(103,'Kohen','Yossi','Dimona','01/08/1987',11,80);

INSERT INTO Students VALUES(104,'Toys','Vered','15/09/1988',90);

/*

Check the records were inserted succesfully

*/

SELECT * FROM Students;

/*

Change 'Address' data type to VARCHAR2(15)

*/

ALTER TABLE Students MODIFY Address VARCHAR2(15);

/*

Check that the data type has changed

*/

DESC Students; -- Some comment

在脚本输出结束时,我收到此错误消息:

错误:对象COMMENT不存在

如果我将注释更改为Hello World,我将获得WORLD“object”的相同错误…

我更改了整个脚本以避免单行注释,结果是一样的.

在这个例子中我可以再次避免它,但我真的想了解是什么导致了这个奇怪的问题……

可能有助于解决问题的另一件事是我在同一个脚本中出现的另一个奇怪的错误,在评论上方几行.在这一行:

ALTER TABLE学生修改地址VARCHAR2(15);

sql Developer在最后两个字符(右括号和分号)下显示错误,指出语法错误.部分认可的规则(铁路图):……

如果我将运行该声明它将工作得很好……

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值