开发环境
名称 | 版本 |
---|---|
操作系统 | Windows 10 X64 |
Oracle | win64_11gR2_database |
PLSQL Developer | 11.0.4.1788(64 bit)01.179332 - Unlimited user license |
问题描述
创建表 sql 如下
--创建表
create table test_v_hwhao1
(
ID varchar2(64) default SYS_GUID() not null,
No varchar2(10),
Name varchar2(10),
Constraint TB_PK_test_v_hwhao1_id Primary key(ID)
);
--表注释
comment on table test_v_hwhao1 is 'test_v_hwhao table';
--字段注释
comment on column test_v_hwhao1.ID is '主键';
comment on column test_v_hwhao1.No is '编号';
comment on column test_v_hwhao1.Name is '名称';
通过 PLSQL Developer
执行没问题,通过 SqlPlus 执行报错
SP2-0042: 未知命令 ")" - 其余行忽略。
问题分析
猜测是英文括号或者文件编码的问题。
问题解决
1.检查了确认括号为英文括号;
2.在 PLSQL Developer
把文件重新另存为 sql
脚本,这一步的目的是让 sql
脚本的文件编码为 PLSQL Developer
默认的文件编码。
测试结果
重新执行脚本,执行成功。