SQL Anywhere 错误 -728:尝试对不可更新的远程查询执行更新操作 [英] SQL Anywhere Error -728: Update operation attempted on non-updatable remote query

查看:42
本文介绍了SQL Anywhere 错误 -728:尝试对不可更新的远程查询执行更新操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做什么:

update table_name set field2 = substring(REGEXP_SUBSTR(field1, 'item=[0-9]+', charindex('item=', field1)), 6)

但是我得到了

SQL Anywhere Error -728: Update operation attempted on non-updatable remote query

我能以某种方式解决它吗?我不使用本地/远程表.我用一张桌子.

Can I solve it somehow? I don't use local/remote tables. I use one table.

推荐答案

所以我想我找到了解决方案......甚至 2.不幸的是仍然无法使用 REGEXP_SUBSTR ...我愿意:

So I guess I found soltion... even 2. Unfortunately still no way to use REGEXP_SUBSTR... I do:

第一

alter table my_table add item_position int null
alter table my_table add is_char int null
alter table my_table add item_part varchar(200) null
alter table my_table add item bigint null    

update my_table set item_position = charindex('item=', field1)+5; 
update my_table set item_part = substring(field1, item_pos, 10); 
update my_table set is_char = charindex('&', clid_part)-1;     
update my_table set item = case when is_char = -1 then item_part else substring(item_part, 1, charindex('&', item_part)-1) end;

cast(str_replace(substring(field1, charindex('item=', field1)+5, 10), substring(substring(field1, charindex('item=', field1)+5, 10), 
(charindex('&', substring(field1, charindex('clid=', field1)+5, 10)))), '') as integer) as item

像这样

这篇关于SQL Anywhere 错误 -728:尝试对不可更新的远程查询执行更新操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆