在sql*plus中执行*.sql文件

在c:/下建一个a.sql文件
文件内容为:

drop table yangbc2.aa;
create table yangbc2.aa as
 select id
  from  yangbc2.a1
  where id='001';

保存文件,在sql*plus里执行@path:/filename
即:
SQL> @c:/a.sql;

drop table yangbc2.aa
                   *
ERROR 位于第 1 行:
ORA-00942: 表或视图不存在
表已创建。

SQL> select * from aa;

ID
----------
001

SQL> select * from yangbc2.aa;

ID
----------
001


你可能感兴趣的:(oracle心得)