Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Why do I get this sqlplus error?
Hi:
I have a sql script file called "test.sql" that I try to run in sqlplus. When I run it, it get the following error:
SQL> @e:\catalog_management\test;
drop table CATALOG_MANAGEMENT.HPXCATALOGBRANCH;
*
ERROR at line 27:
ORA-06550: line 27, column 1: PLS-00103: Encountered the symbol "DROP" when expecting one of the following:
The drop table command is the first command in "drop_tabs_catalog_management.sql" file.
I am wondering why I got the error.
Thanks.
Guang
PS: Here is the code for "test.sql":
set serveroutput on
declare
TABLE_COUNT NUMBER;
begin
select count(*) into TABLE_COUNT from all_tables where owner='CATALOG_MANAGEMENT';
if TABLE_COUNT > 0 then
dbms_output.put_line ('Error: There are tables in schema CATALOG_MANAGEMENT!');
dbms_output.put_line ('Table Count = ' || TABLE_COUNT); @e:\catalog_management\drop_tabs_catalog_management.sql;
else
NUll; @e:\catalog_management\copy_from_prod_to_catalog_mang.sql;
end if;
end;
/