469,326 Members | 1,534 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

MySQL statement length

I'm not finding what the maximum number of characters that a statement
can be. Anyone know where I can find that spec?
Jan 14 '07 #1
4 12796
Roy Epperson wrote:
I'm not finding what the maximum number of characters that a statement
can be. Anyone know where I can find that spec?
I have found it hard to find this stat as well. I could not find a
definitive answer, but I believe the maximum length of a SQL statement
is 1MB.

It may be the case that the programming interface you use may impose a
shorter limit on the query length than that supported by the MySQL server.

Regards,
Bill K.
Jan 15 '07 #2
Roy Epperson wrote:
I'm not finding what the maximum number of characters that a statement
can be. Anyone know where I can find that spec?
Are you having problems or just looking for some spec?

http://dev.mysql.com/doc/refman/5.0/...too-large.html

" A communication packet is a single SQL statement sent to the MySQL server, a
single row that is sent to the client, or a binary log event sent from a master
replication server to a slave.

The largest possible packet that can be transmitted to or from a MySQL 5.0
server or client is 1GB."

The C API is limited appears to be 16Mb.

Is there some reason for creating a single statement that long?

--
Michael Austin
Database Consultant
Domain Registration and Linux/Windows Web Hosting Reseller
http://www.spacelots.com
Jan 15 '07 #3
Thanks Bill, I suspect that JDBC will allow close to that....

Bill Karwin wrote:
Roy Epperson wrote:
>I'm not finding what the maximum number of characters that a statement
can be. Anyone know where I can find that spec?

I have found it hard to find this stat as well. I could not find a
definitive answer, but I believe the maximum length of a SQL statement
is 1MB.

It may be the case that the programming interface you use may impose a
shorter limit on the query length than that supported by the MySQL server.

Regards,
Bill K.
Jan 15 '07 #4
Michael,
Not having a problem and don't expect to if the JDBC limit is close to
the C API limit. I've using a `select * from aTable where columnName in
(<list_of_primary_keys>)` statement there the primary key is an
autonumber.
Roy

Michael Austin wrote:
Roy Epperson wrote:
>I'm not finding what the maximum number of characters that a statement
can be. Anyone know where I can find that spec?

Are you having problems or just looking for some spec?

http://dev.mysql.com/doc/refman/5.0/...too-large.html

" A communication packet is a single SQL statement sent to the MySQL
server, a single row that is sent to the client, or a binary log event
sent from a master replication server to a slave.

The largest possible packet that can be transmitted to or from a MySQL
5.0 server or client is 1GB."

The C API is limited appears to be 16Mb.

Is there some reason for creating a single statement that long?
Jan 15 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mike Chirico | last post: by
reply views Thread by rabbit | last post: by
reply views Thread by nrip | last post: by
9 posts views Thread by PI | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.