文档首页> 数据仓库服务 GaussDB(DWS)> 故障排除> 数据库使用> 执行业务报错:unable to get a stable set of rows in the source table
更新时间:2022-09-30 GMT+08:00
分享

执行业务报错:unable to get a stable set of rows in the source table

问题现象

merge into的作用是将源表内容根据匹配条件对目标表做更新或插入,当目标表匹配到多行满足条件时,GaussDB(DWS)有以下两种行为:

  1. 业务报错:unable to get a stable set of rows in the source table
  2. 随机匹配一行数据,可能会导致实际与预期不符

原因分析

进行merge into操作对目标表做更新或插入,目标表匹配到多行满足条件时出现该报错。

处理方法

这两种行为由参数behavior_compat_options控制,当参数behavior_compat_options缺省的情况下,匹配到多行会报错,如果behavior_compat_options被设置为merge_update_multi,这种情况下不会报错,而是会随机匹配一行数据。

因此,当出现merge into的结果与预期不符时,需查看该参数是否被设置,同时排查是否匹配了多行数据,并修改业务逻辑。

分享:

    相关文档

    相关产品