SQLite错误:复合SELECT中的术语过多 [英] SQLite error: too many terms in compound SELECT

查看:160
本文介绍了SQLite错误:复合SELECT中的术语过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在sqlite数据库文件中插入太多数据时,发生错误复合SELECT中的术语过多".我使用"insert into ... select ... union select ... union ...".我知道它的选择语句太多,但是我的问题是:复合SELECT语句中最多可包含多少项?

When I insert too many data into sqlite database file, an error "too many terms in compound SELECT" occurs. I use "insert into ... select ... union select ... union ...". I know it's too many select statements, but my question is: What's the maximum number of terms in a compound SELECT statement?

推荐答案

复合SELECT语句是由运算符UNION,UNION ALL,EXCEPT或INTERSECT连接的两个或多个SELECT语句.我们将复合SELECT中的每个单独的SELECT语句称为项".

A compound SELECT statement is two or more SELECT statements connected by operators UNION, UNION ALL, EXCEPT, or INTERSECT. We call each individual SELECT statement within a compound SELECT a "term".

SQLite中的代码生成器使用递归算法处理复合SELECT语句.为了限制堆栈的大小,因此我们限制了复合SELECT中的项数.术语的最大数量为SQLITE_MAX_COMPOUND_SELECT,默认值为500.我们认为这是一个慷慨的分配,因为在实践中,我们几乎从来没有看到复合选择中的术语数量超过个位数.

The code generator in SQLite processes compound SELECT statements using a recursive algorithm. In order to limit the size of the stack, we therefore limit the number of terms in a compound SELECT. The maximum number of terms is SQLITE_MAX_COMPOUND_SELECT which defaults to 500. We think this is a generous allotment since in practice we almost never see the number of terms in a compound select exceed single digits.

可以在运行时使用sqlite3_limit(db,SQLITE_LIMIT_COMPOUND_SELECT,size)接口降低复合SELECT术语的最大数量.

The maximum number of compound SELECT terms can be lowered at run-time using the sqlite3_limit(db,SQLITE_LIMIT_COMPOUND_SELECT,size) interface.

有关更多详细信息,请检查此... http://www.sqlite.org/limits.html

for more details please check this... http://www.sqlite.org/limits.html

这篇关于SQLite错误:复合SELECT中的术语过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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