当前位置: 首页 > news >正文

机加工外贸网站自己怎么做网址

机加工外贸网站,自己怎么做网址,服装公司发展规划,沈阳网站制作公司哪家好LightDB 支持 ignore_row_on_dupkey_index hint LightDB 从23.4 开始支持oracle的 ignore_row_on_dupkey_index hint, 这个hint是用来忽略唯一键冲突的。类似与mysql的 insert ignore。 语法如下: 在LightDB中ignore_row_on_dupkey_index的效果等同于o…

LightDB 支持 ignore_row_on_dupkey_index hint

LightDB 从23.4 开始支持oracle的 ignore_row_on_dupkey_index hint, 这个hint是用来忽略唯一键冲突的。类似与mysql的 insert ignore。

语法如下:

Description of ignore_row_on_dupkey_index.eps follows

在LightDB中ignore_row_on_dupkey_index的效果等同于on conflict do nothing 子句。

下面说明一下这个hint的注意点以及使用示例。

注意点

  • 您必须指定一个正确的索引。如果没有指定索引,那么该语句将导致LT008错误(oracle是ORA-38912)。
  • 如果指定了多个索引,那么该语句会导致LT010错误(oracle是ORA-38915)。
  • 如果指定了index,那么索引必须存在且唯一。否则,该语句导致LT009错误(oracle是ORA-38913)。
  • IGNORE_ROW_ON_DUPKEY_INDEX提示仅适用于单表插入操作。
  • 如果指定的列对应有多个索引,那么这条语句会导致LT010错误(oracle没有这个特性,因为同一个字段不能有多个索引)。
  • 不能与on conflict 一起使用(oracle 没有on conflict)
  • 在Canopy 下,目前只支持对insert select 使用,且select 的表也需要为分布式表。

note

在ltsql 中可以通过\errverbose 查看错误码及其他详细信息

lightdb@postgres=# \errverbose
ERROR:  LT008: An index must be specified in the index hint
LOCATION:  IgnoreDupKeyHintParse, pg_hint_plan.c:7232
lightdb@postgres=# 

使用示例

初始化

create table test_ignore_dupkey(key1 int, key2 int, key3 int, key4 int);
create unique index test_ignore_dupkey_ui1 on test_ignore_dupkey(key1, key2);
create unique index test_ignore_dupkey_ui2 on test_ignore_dupkey(key3, key4);
create index test_ignore_dupkey_i on test_ignore_dupkey(key3);

示例

lightdb@postgres=# insert into test_ignore_dupkey values(1, 1, 1, 1);
INSERT 0 1
lightdb@postgres=# insert into test_ignore_dupkey values(1, 1, 1, 1);
ERROR:  duplicate key value violates unique constraint "test_ignore_dupkey_ui1"
DETAIL:  Key (key1, key2)=(1, 1) already exists.
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey  test_ignore_dupkey_ui1) */ into test_ignore_dupkey values(1, 1, 1, 2);
INSERT 0 0
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey(key1, key2)) */ into test_ignore_dupkey values(1, 1, 1, 2);
INSERT 0 0
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey) */ into test_ignore_dupkey values(1, 1, 1, 2);
ERROR:  An index must be specified in the index hint
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey test_ignore_dupkey_ui3) */ into test_ignore_dupkey values(1, 1, 1, 2);
ERROR:  An index must be specified in the index hint
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey test_ignore_dupkey_i) */ into test_ignore_dupkey values(1, 1, 1, 2);
ERROR:  Index specified in the index hint is invalid
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey test_ignore_dupkey_ui1 test_ignore_dupkey_ui2) */ into test_ignore_dupkey values(1, 1, 1, 2);
ERROR:  Multiple indexes in ignore duplicate key hint
lightdb@postgres=# update/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey  test_ignore_dupkey_ui1) */ test_ignore_dupkey set key2 = 2 where key1 = 1;
ERROR:  IGNORE_ROW_ON_DUPKEY_INDEX hint disallowed for this operation
lightdb@postgres=# create unique index test_ignore_dupkey_ui3 on test_ignore_dupkey(key3, key4);
CREATE INDEX
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey(key3, key4)) */ into test_ignore_dupkey values(1, 2, 1, 1);
ERROR:  Multiple indexes in ignore duplicate key hint
DETAIL:  find multiple indexes by fields
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey  test_ignore_dupkey_ui1) */ into test_ignore_dupkey values(1, 1, 1, 2)
lightdb@postgres-# on conflict (key1, key2) do nothing;
ERROR:  IGNORE_ROW_ON_DUPKEY_INDEX hint disallowed for this operation
DETAIL:  insert operation with on confict clause is not supported
lightdb@postgres=# 下面与 oracle 不同, 对于(test_ignore_dupkey()), oracle 是hint语法错误,不会报错
lightdb@postgres=# insert/*+IGNORE_ROW_ON_DUPKEY_INDEX(test_ignore_dupkey()) */ into test_ignore_dupkey values(1, 2, 1, 1);
ERROR:  An index must be specified in the index hint
http://www.mmbaike.com/news/106985.html

相关文章:

  • 房地产市场形势分析郑州seo服务公司
  • 做网站闵行seo主要优化
  • asp企业网站源码seo网站推广首页排名
  • 网站建设技术问题2024年1月新冠高峰
  • wordpress目录upgrade西安seo顾问培训
  • 石家庄最新招聘信息58广州seo优化电话
  • 做情趣导航网站可以吗百度代理加盟
  • 网站建立平台ui设计
  • 初二做网站的首页模板网站排名seo
  • 如何看配色网站哪里可以接广告
  • 商会网站建设柳州今日头条新闻
  • 网站遇到攻击时应该怎么做厦门百度关键词推广
  • 可以做软文推广的网站百度指数分析平台
  • 网站域名备案更改吗seo双标题软件
  • 文化共享工程网站建设情况百度手机卫士
  • 各种网站制作百度搜索竞价排名
  • WordPress首页做成插件seo的范畴是什么
  • wordpress 获取文章url惠州自动seo
  • 如何免费做网站网页上海谷歌推广
  • 租空间做网站需要多少钱长春网站优化
  • 威联通做网站优化模型的推广
  • 企业网站定制开发一条龙全包连云港seo优化
  • 网站建设开发程序seo权重查询
  • 做直播网站如何让关键词排名靠前
  • 网站开发地图导航页面石家庄百度搜索引擎优化
  • 徐州网站外包营销方案案例范文
  • 东南亚cod建站系统软文广告的案例
  • 深圳网站建设公司多少钱深圳推广公司哪家最好
  • 发布网站需要备案百度网盘客服电话24小时
  • 58同城做网站的电话上海最新发布