日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle ora01732,一天一小步_2008.5.02: ora-01732错误

發布時間:2024/2/28 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle ora01732,一天一小步_2008.5.02: ora-01732错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前兩天老大在從一個表中刪除數據的時候碰到了01732錯誤,可一查文檔才知道01732是對視圖的操作不合法才能碰到的,這是官方的定義:

ORA-01732 data manipulation operation not legal on this

view

Cause: An attempt was made to use an UPDATE, INSERT, or

DELETE

statement on a view that contains expressions or functions or was

derived from

more than one table. If a join operation was used to create the

view or the view

contains virtual columns derived from functions or expressions,

then the view

may only be queried.

Action: UPDATE, INSERT, or DELETE rows in the base tables instead

and

restrict the operations on the view to queries.

可是我們當時從dba_objects中查哪個對象確實顯示是個表,老大也說那是個表,到底怎么回事呢?后來google了,也沒有搜出個所以然來,這里有兩篇文章好像都提到了這個問題可是也沒有最終的解決方法,

這里又搜到的一篇文章,可能有用,把他貼出來:

ORA-01732:?Data manipulation operation not

legal on this view

You are trying to update or

delete a materialized view, but the materialized view was created

with the default option of read only.

The truncate command however works perfect.

You'll have to specify the for update clause when you create

a materialized view.

eg:

SQL> desc t

Name?Null??Type

----------------------------------------- -------- -------

C?NUMBER

create materialized view v

REFRESH FORCE WITH ROWID

DISABLE QUERY REWRITE AS

(

select * from t

)

/

SQL> delete from v;

delete from v

*

ERROR at line 1:

ORA-01732: data manipulation operation not legal on this view

SQL> truncate table v;

Table truncated.

SQL> drop materialized view v;

Materialized view dropped.

SQL> create materialized view v

2?REFRESH FORCE WITH

ROWID

3?for update

4?DISABLE QUERY REWRITE

AS

5?(

6?select * from t

7?);

Materialized view created.

SQL> delete from v;

2 rows deleted.

雖然這個問題還沒有解決,我也沒有什么好的辦法,但綜合搜索的結果,我有以下幾個處理的思路:

1.首先5月4號去了之后搞清楚出問題哪個表的類型,到底是一個表、視圖還是物化視圖?也即搞清楚這個對象的詳細定義,oracle

9i

之后提供了DBMS_METADATA包,明天就來研究一下這個包的使用。

2.參考這個:

Ian,

You are correct. If you're connected as FARS_OWNER the public

synonym will not be referenced since you own a table named

MFGALIASTYPE.

I suspect the error is not being signaled by the insert itself,

but by some underlying recursive sql. Is there a trigger on this

table? If not, the trace file generated by the following events

should help (you may need to log a tar with support for assistance

in reading the trace file).

alter session set events '10046 trace name context forever,

level 4';

alter session set events 1732 trace name errorstack forever, level

10';

和itpub上某位版主的建議,我覺得應該用10046事件來追蹤一下,對10046還不是很熟悉,后天再研究一下10046.

大概想到就這兩點,現在沒有環境,就做些準備工作,5.4去了再好好研究研究這個。

總結

以上是生活随笔為你收集整理的oracle ora01732,一天一小步_2008.5.02: ora-01732错误的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。