how to resolve 'Update operation attempted on non-updatable query'?

↘锁芯ラ 提交于 2019-12-02 15:03:49

问题


I am working on a sybase-iq server Sybase IQ/15.4.0.3014

I have a working query to update one field of a table as below

update  table1
set     a.field1= b.some_value
from    table1 a,
        table2 b
where   a.id = b.id

This is working fine when I execute it from a sql session. When it is being called from a high level application, I am getting the below error for the above query

SQL Exception code is 7301
Update operation attempted on non-updatable query

I am not able to find why I am getting this error. Is there any solution to amend the query. Searching on the internet is not helping much.

Have anyone come across such issue?


回答1:


You attempted an insert, update, or delete operation on a query that is implicitly read-only. You're trying to update system table or table which cannot be changed in that manner.

link




回答2:


down vote

I suggest to double check that table_name is actually a table, but not a view. If it is a view, you may see its definition with sp_helptext command, such as

sp_helptext 'view_name'

or

sp_helptext 'schema_name.view_name'



来源:https://stackoverflow.com/questions/19299244/how-to-resolve-update-operation-attempted-on-non-updatable-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!