Sybase 更新表时出错
我在 Sybase 表上发出 UPDATE 语句,但收到以下错误:
消息 325,级别 18,状态 4: 服务器“dev”,第 1 行: Adaptive Server 找不到该语句的合法查询计划。如果是摘要 Plan是强制执行查询计划,检查其与查询的对应关系。如果不, 请联系 Sybase 技术支持。
这是我的更新声明。
Update TABLE1 SET SAMPLECOL = (
Select
TABLE2.SAMPLECOL
from TABLE2
where
TABLE2.COMMON_ID = TABLE1.COMMON_ID
)
where
TABLE1.TABLE1_ID in (
Select
TABLE1.TABLE1_ID
from TABLE1
inner join TABLE2
on TABLE1.COMMON_ID = TABLE2.COMMON_ID
where TABLE1.SAMPLECOL = ''
)
任何见解将不胜感激。
I am issuing an UPDATE Statement on a Sybase table but I am getting the below error:
Msg 325, Level 18, State 4:
Server 'dev', Line 1:
Adaptive Server finds no legal query plan for this statement. If an Abstract
Plan is forcing the query plan, check its correspondence to the query. If not,
please contact Sybase Technical Support.
Here is my UPDATE Statement.
Update TABLE1 SET SAMPLECOL = (
Select
TABLE2.SAMPLECOL
from TABLE2
where
TABLE2.COMMON_ID = TABLE1.COMMON_ID
)
where
TABLE1.TABLE1_ID in (
Select
TABLE1.TABLE1_ID
from TABLE1
inner join TABLE2
on TABLE1.COMMON_ID = TABLE2.COMMON_ID
where TABLE1.SAMPLECOL = ''
)
Any insights will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为问题在于您正在使用可能返回多个值的内容设置列
SAMPLECOL
。尝试执行此操作并将结果发布回此处:(这将仅选择一行记录,您的逻辑可能无法基于此工作,但是就您收到的错误而言,我确信与此相关)。再次尝试并让我们知道结果。
I THINK the problem is that you are setting the column
SAMPLECOL
with something which could return multiple values. Try doing this and post the result back here:(this will select only one row record and your logic might not work based on this, however as far as the error you are getting I am sure is related to this). Again try it and let us know the outcome.
尝试代替;
try instead;