Bol*_*lha 5 oracle sqlplus ora-00955
我正在尝试创建一个打印消息然后创建表的 PL/SQL 脚本。
如果我在 SqlPlus 中运行脚本,则会打印消息,创建表,但我收到一条错误消息,指出该表正在使用中。似乎“创建表”正在运行两次。在 SQLDeveloper 中,我没有错误。
这是我的脚本:
set serveroutput on
begin
  dbms_output.Put_line('running test.sql');
end;
/
create table my_table
(
  name varchar2(100) not null
);
/
Run Code Online (Sandbox Code Playgroud)
这是输出:
SQL> @test.sql
running test.sql
PL/SQL procedure successfully completed.
Table created.
create table my_table
             *
ERROR at line 1:
ORA-00955: name is already used by an existing object    
SQL>
Run Code Online (Sandbox Code Playgroud)
我做错了什么?
提前致谢。
小智 -1
将脚本更改为:
set serveroutput on
begin
   dbms_output.Put_line('running test.sql');
   create table my_table
   (
     name varchar2(100) not null
   );
end
/
Run Code Online (Sandbox Code Playgroud)