An SQL statement is an SQL command or function with all its parameters (as needed) to carry out the command - SELECT is a function, UPDATE is another, CREATE TABLE is another, etc.

My use of the word command or function might be somewhat off - others can say better, or go to the IBM i manuals - RTFM.

All those parameters are actually presented as claused - SQL means "Strtuctured Query Language", after all - it is a human-like language for manipulating data in tables. In that sense, a statement is like an imperative sentence - and sentences have clauses.

Clauses for a SELECT include the FROM clause, the WHERE clause, the GROUP BY clause, etc. So the maximum length is just that - the number of characters you can have in a statement, including its constituent clauses.

Correct me if I'm wrong, but it sounds like you're pretty new to SQL - we all were! I recommend going to www.w3schools.com and check out their tutorial on SQL - it will be pretty useful for any version of SQL, including the one on IBM i.

As Rob suggests, there might be limits in the ODBC driver, you'd need to RTFM for the documentation - it's on IBM KnowledgeCenter for IBM i, of course. If you're using a non-IBM ODBC driver, you have to talk to their support folks or find their documentation.

HTH
Vern

On 4/8/2019 8:09 AM, Spencer Elliott wrote:
Hi,
The maximum length of an SQL statement (in bytes) = 2,097,152
Maximum number of predicates in a WHERE or HAVING clause = *statement*

Got any idea what "*statement*" means? Does it mean that it is limited by
the statement size?

Also, does this really mean I can submit a single SQL statement to the IBM
i through ODBC that is 2 Mb?

Thank you,

Spencer C Elliott


949-366-5234 X152 (O) l (949) 544-1237 (Skype)

Spencer@xxxxxxxxxxxxxx


www.s4isystems.com

Follow us:

[image: Follow_us][image: Follow_us][image: Follow_us][image: Follow_us][image:
Follow_us]

NOTE: This email message and any attachments are for the sole use of the
intended recipient(s) and may contain confidential and/or privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the
sender by replying to this email, and destroy all copies of the original
message.


On Mon, Apr 8, 2019 at 4:42 AM Rob Berendt <rob@xxxxxxxxx> wrote:

These may be correct
http://www.ibm.com/support/knowledgecenter/
Search for IBM i
IBM i 7.2 documentation
Availability
Maximum capacities
SQL limits
SQL
Maximum length of an SQL statement (in bytes)
Maximum number of predicates in a WHERE or HAVING clause

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Spencer Elliott
Sent: Sunday, April 7, 2019 1:49 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Maximum OBDC Query Size

Hi,
Does anyone know the maximum size of a SQL Query that can be issued to a
V7R2 system through OBDC? Also, what is the maximum size of a WHERE clause?

Thank you,

Spencer C Elliott


949-366-5234 X152 (O) l (949) 544-1237 (Skype)

Spencer@xxxxxxxxxxxxxx


www.s4isystems.com

Follow us:

[image: Follow_us][image: Follow_us][image: Follow_us][image:
Follow_us][image:
Follow_us]

NOTE: This email message and any attachments are for the sole use of the
intended recipient(s) and may contain confidential and/or privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the
sender by replying to this email, and destroy all copies of the original
message.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.