SQL Oracle中的最大语句长度是多少

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14355819/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 13:10:02  来源:igfitidea点击:

What is the maximum statement length in Oracle

sqloracleoracle10goracle-sqldeveloper

提问by BenoitParis

I'm building a SQL statement that contains data and I'm wondering if I would break some maximum statement length in Oracle 10g.

我正在构建一个包含数据的 SQL 语句,我想知道是否会打破 Oracle 10g 中的某些最大语句长度。

The statement would be about 3 200 000 bytes, cannot be split and has to be parsable in its entirety.

该语句大约有 3 200 000 个字节,不能拆分并且必须可以整体解析。

Before I'm investing too much time this way, I was wondering if I would be limited by the size of this statement.

在我以这种方式投入太多时间之前,我想知道我是否会受到此声明的大小的限制。

I am using SQL developer but I think that if the server can do it, so can SQL developer.

我正在使用 SQL 开发人员,但我认为如果服务器可以做到,那么 SQL 开发人员也可以。

回答by Chris

There is no fixed number. See "Logical Database Limits": http://docs.oracle.com/cd/B19306_01/server.102/b14237/limits003.htm

没有固定数量。请参阅“逻辑数据库限制”:http: //docs.oracle.com/cd/B19306_01/server.102/b14237/limits003.htm

"The limit on how long a SQL statement can be depends on many factors, including database configuration, disk space, and memory".

“SQL 语句的长度限制取决于许多因素,包括数据库配置、磁盘空间和内存”。

You might also be affected by other limits, such as the maximum levels of subqueries.

您可能还会受到其他限制的影响,例如子查询的最大级别。

Given that the maximum length of PL/SQL procedures is given as 2000-3000 lines, my feeling is that you may run into problems with a 3M bytes query. I also think that if it works at all, the parse time will be "interesting".

鉴于 PL/SQL 过程的最大长度为 2000-3000 行,我的感觉是您可能会遇到 3M 字节查询的问题。我还认为,如果它真的有效,解析时间将是“有趣的”。

回答by Thomas Rieder

According 11.2 Limits documentation:

根据 11.2 限制文档:

Maximum length of SQL statement, including the NULL terminator. 409,600

SQL 语句的最大长度,包括 NULL 终止符。409,600

https://docs.oracle.com/cd/E11882_01/timesten.112/e21643/limit.htm#TTREF455

https://docs.oracle.com/cd/E11882_01/timesten.112/e21643/limit.htm#TTREF455