I'm trying to create a PL/SQL script that prints a message and then creates a table.
If I run the script in SqlPlus, the message is printed, the table is created, but I receive an error message saying the table is in use. It seems the "create table" is running twice. In SQLDeveloper I have no errors.
This is my script:
set serveroutput on
begin
dbms_output.Put_line('running test.sql');
end;
/
create table my_table
(
name varchar2(100) not null
);
/
This is the output:
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>
What I'm doing wrong?
Thanks in advance.