;是一个sqlplus 命令。edit 编辑的sql buffer中不能出现命令:EDITSyntaxED[IT] [file_name[.ext]]where file_name[.ext] represents the file you wish to edit (typically a script).Invokes an operating system text editor on the contents of the specified file or on the contents of the buffer. !!!The buffer has no command history list and does not record SQL*Plus commands!!!
select emp_id from Employees;Employees ( emp_id number primary key, name varchar(50), login varchar(50) not null, pass varchar(50), purview varchar(10) default 'use', status varchar(10) default 'yes' ); / 不行吗? 是不是你的数据设置的问题?或者权限不对?
SQL> create table Employees ( 2 emp_id number primary key, 3 name varchar(50), 4 login varchar(50) not null, 5 pass varchar(50), 6 6 purview varchar(10) default 'use', 7 status varchar(10) default 'yes' 8 ) 9 ;Table createdSQL> drop table Employees;Table dropped
emp_id number primary key,
name varchar(50),
login varchar(50) not null,
pass varchar(50),
purview varchar(10) default 'use',
status varchar(10) default 'yes'
);
这样有问题???
2 bb varchar(12),
3 cc varchar(13)
4 );已建立表格.測試成功了的
SQL> edit
已写入文件 afiedt.buf
1 create table Employees1 (
2 emp_id number primary key,
3 name varchar(50),
4 login varchar(50) not null,
5 pass varchar(50),
6 purview varchar(10) default 'use',
7 status varchar(10) default 'yes'
8* );
9 /
);
*
ERROR 位于第 8 行:
ORA-00911: 无效字符
2 emp_id number primary key,
3 name varchar(50),
4 login varchar(50) not null,
5 pass varchar(50),
6 purview varchar(10) default 'use',
7 status varchar(10) default 'yes');已建立表格.我也是9I,我可以
emp_id number primary key,
name varchar(50),
login varchar(50) not null,
pass varchar(50),
purview varchar(10) default 'use',
status varchar(10) default 'yes'
);
没有问题,你在sqlplus下"l"看一下缓冲区中的语句是否和这句一致。
SQL> create table Employees1 (
2 emp_id number primary key,
3 name varchar(50),
4 login varchar(50) not null,
5 pass varchar(50),
6 purview varchar(10) default 'use',
7 status varchar(10) default 'yes');
加上逗号后去掉分号,直接Copy到相应的环境中
执行。注:在不同的执行环境下,有不同的要求,比如在SQL*Plus中这个语句可能通过,
但在一些第三方工具中执行却不行,还是根据相应的需求进行更改的
好,千万不可强求,也不要在这类问题上问为什么!!!
emp_id number primary key,
name varchar(50),
login varchar(50) not null,
pass varchar(50),
purview varchar(10) default 'use',
status varchar(10) default 'yes'
);
/
不行吗?
是不是你的数据设置的问题?或者权限不对?
2 emp_id number primary key,
3 name varchar(50),
4 login varchar(50) not null,
5 pass varchar(50),
6
6 purview varchar(10) default 'use',
7 status varchar(10) default 'yes'
8 )
9 ;Table createdSQL> drop table Employees;Table dropped
你少了逗号!!!
----------------------------------------------------------------------------
SQL> edit
已写入文件 afiedt.buf 1 create table Employees8 (
2 emp_id number primary key,
3 name varchar(50),
4 login varchar(50) not null,
5 pass varchar(50),
6 purview varchar(10) default 'use',
7* status varchar(10) default 'yes');
SQL>
SQL> /
status varchar(10) default 'yes');
*
ERROR 位于第 7 行:
ORA-00911: 无效字符-----------------------------------------------------------------------------
我用@e:\employees.sql;执行通过,
直接从记事本复制到SQL PLUS中也能通过,不过光标落在分号后面,一按回车就执行通过。
就是不能用EDIT命令(如上)