執行:
CREATE TABLE TMP_TBX_100_0_S3 AS SELECT t.* FROM (select t1.*,NULL AS sdate, NULL AS report_id from TMP_TBX_100_0_S4_1 t1?union all?
select t2.* from TMP_TBX_100_0_S4_2 t2) t
報錯:
ORA-00955: name is already used by an existing object
現象:
drop table TMP_TBX_100_0_S4?提示不錯在表名或視圖。
select * from?TMP_TBX_100_0_S4
報錯:
ORA-04063: view "DAILY.TMP_TBX_100_0_S4" 有錯誤
04063. 00000 - ?"%s has errors"
*Cause: ? ?Attempt to execute a stored procedure or use a view that has
? ? ? ? ? ?errors. ?For stored procedures, the problem could be syntax errors
? ? ? ? ? ?or references to other, non-existent procedures. ?For views,
? ? ? ? ? ?the problem could be a reference in the view's defining query to
? ? ? ? ? ?a non-existent table.
? ? ? ? ? ?Can also be a table which has references to non-existent or
? ? ? ? ? ?inaccessible types.
*Action: ? Fix the errors and/or create referenced objects as necessary.
原因:
查了很多資料,百思不得其解,后來把
drop table?TMP_TBX_100_0_S4 改成?drop view?TMP_TBX_100_0_S4。成功了!
原來是,存在名為?TMP_TBX_100_0_S4 的視圖,不存在名為TMP_TBX_100_0_S4 的表。
反之亦然