The following tables describe certain SQL limits. Adhering to the
most restrictive case can help the programmer design application programs that
are easily portable.
Table 26. Identifier Length Limits
Description | Limit | |
---|---|---|
1 | Smallest INTEGER value | -2 147 483 648 |
2 | Largest INTEGER value | +2 147 483 647 |
3 | Smallest BIGINT value | -9 223 372 036 854 775 808 |
4 | Largest BIGINT value | +9 223 372 036 854 775 807 |
5 | Smallest SMALLINT value | -32 768 |
6 | Largest SMALLINT value | +32 767 |
7 | Largest decimal precision | 31 |
8 | Smallest DOUBLE value | -1.79769E+308 |
9 | Largest DOUBLE value | +1.79769E+308 |
10 | Smallest positive DOUBLE value | +2.225E-307 |
11 | Largest negative DOUBLE value | -2.225E-307 |
12 | Smallest REAL value | -3.402E+38 |
13 | Largest REAL value | +3.402E+38 |
14 | Smallest positive REAL value | +1.175E-37 |
15 | Largest negative REAL value | -1.175E-37 |
Description | Limit | |
---|---|---|
1 | Maximum length of CHAR (in bytes) | 254 |
2 | Maximum length of VARCHAR (in bytes) | 32 672 |
3 | Maximum length of LONG VARCHAR (in bytes) | 32 700 |
4 | Maximum length of CLOB (in bytes) | 2 147 483 647 |
5 | Maximum length of GRAPHIC (in characters) | 127 |
6 | Maximum length of VARGRAPHIC (in characters) | 16 336 |
7 | Maximum length of LONG VARGRAPHIC (in characters) | 16 350 |
8 | Maximum length of DBCLOB (in characters) | 1 073 741 823 |
9 | Maximum length of BLOB (in bytes) | 2 147 483 647 |
10 | Maximum length of character constant | 32 672 |
11 | Maximum length of graphic constant | 16 336 |
12 | Maximum length of concatenated character string | 2 147 483 647 |
13 | Maximum length of concatenated graphic string | 1 073 741 823 |
14 | Maximum length of concatenated binary string | 2 147 483 647 |
15 | Maximum number of hex constant digits | 16 336 |
16 | Maximum size of a catalog comment (in bytes) | 254 |
Description | Limit | |
---|---|---|
1 | Smallest DATE value | 0001-01-01 |
2 | Largest DATE value | 9999-12-31 |
3 | Smallest TIME value | 00:00:00 |
4 | Largest TIME value | 24:00:00 |
5 | Smallest TIMESTAMP value | 0001-01-01-00.00.00.000000 |
6 | Largest TIMESTAMP value | 9999-12-31-24.00.00.000000 |
Table 30. Database Manager Limits
Description | Limit | |||
---|---|---|---|---|
1 | Most columns in a table g | 1 012 | ||
2 | Most columns in a view a | 5 000 | ||
3 | Maximum length of a row including all overhead b g | 32 677 | ||
4 | Maximum size of a table per partition (in gigabytes) c g | 512 | ||
5 | Maximum size of an index per partition (in gigabytes) | 512 | ||
6 | Most rows in a table per partition | 4 x 109 | ||
7 | Longest index key including all overhead (in bytes) | 1 024 | ||
8 | Most columns in an index key | 16 | ||
9 | Most indexes on a table | 32 767 or storage | ||
10 | Most tables referenced in an SQL statement or a view | storage | ||
11 | Most host variable declarations in a precompiled program c | storage | ||
12 | Most host variable references in an SQL statement | 32 767 | ||
13 | Longest host variable value used for insert or update (in bytes) | 2 147 483 647 | ||
14 | Longest SQL statement (in bytes) | 65 535 | ||
15 | Most elements in a select listg | 1 012 | ||
16 | Most predicates in a WHERE or HAVING clause | storage | ||
17 | Maximum number of columns in a GROUP BY clause g | 1 012 | ||
18 | Maximum total length of columns in a GROUP BY clause (in bytes)g | 32 677 | ||
19 | Maximum number of columns in an ORDER BY clause g | 1 012 | ||
20 | Maximum total length of columns in an ORDER BY clause (in bytes) g | 32 677 | ||
21 | Maximum size of an SQLDA (in bytes) | storage | ||
22 | Maximum number of prepared statements | storage | ||
23 | Most declared cursors in a program | storage | ||
24 | Maximum number of cursors opened at one time | storage | ||
25 | Most tables in an SMS table space | 65 534 | ||
26 | Maximum number of constraints on a table | storage | ||
27 | Maximum level of subquery nesting | storage | ||
28 | Maximum number of subqueries in a single statement | storage | ||
29 | Most values in an INSERT statement g | 1 012 | ||
30 | Most SET clauses in a single UPDATE statement g | 1 012 | ||
31 | Most columns in a UNIQUE constraint (supported via a UNIQUE index) | 16 | ||
32 | Maximum combined length of columns in a UNIQUE constraint (supported via a UNIQUE index) (in bytes) | 1 024 | ||
33 | Most referencing columns in a foreign key | 16 | ||
34 | Maximum combined length of referencing columns in a foreign key (in bytes) | 1 024 | ||
35 | Maximum length of a check constraint specification (in bytes) | 65 535 | ||
36 | Maximum number of columns in a partitioning key e | 500 | ||
37 | Maximum number of rows changed in a unit of work | storage | ||
38 | Maximum number of packages | storage | ||
39 | Most constants in a statement | storage | ||
40 | Maximum concurrent users of server d | 64 000 | ||
41 | Maximum number of parameters in a stored procedure | 32 767 | ||
42 | Maximum number of parameters in a user defined function | 90 | ||
43 | Maximum run-time depth of cascading triggers | 16 | ||
44 | Maximum number of simultaneously active event monitors | 32 | ||
45 | Maximum size of a regular DMS table space (in gigabytes)c g | 512 | ||
46 | Maximum size of a long DMS table space (in terabytes)c | 2 | ||
47 | Maximum size of a temporary DMS table space (in terabytes)c | 2 | ||
48 | Maximum number of databases per instance concurrently in use | 256 | ||
49 | Maximum number of concurrent users per instance | 64 000 | ||
50 | Maximum number of concurrent applications per database | 1 000 | ||
51 | Maximum depth of cascaded triggers | 16 | ||
52 | Maximum partition number | 999 | ||
53 | Most table objects in DMS table space f | 51 000 | ||
54 | Longest variable index key part (in bytes) | 255 | ||
55 | Maximum number of columns in a data source table or view that is referenced by a nickname | 5 000 | ||
|
Table 31. Database Manager Page Size Specific Limits
Description | 4K page size limit | 8K page size limit | 16K page size limit | 32K page size limit | |
---|---|---|---|---|---|
1 | Most columns in a table | 500 | 1 012 | 1 012 | 1 012 |
3 | Maximum length of a row including all overhead | 4 005 | 8 101 | 16 293 | 32 677 |
4 | Maximum size of a table per partition (in gigabytes) | 64 | 128 | 256 | 512 |
5 | Maximum size of an index per partition (in gigabytes) | 64 | 128 | 256 | 512 |
15 | Most elements in a select list | 500 | 1 012 | 1 012 | 1 012 |
17 | Maximum number of columns in a GROUP BY clause | 500 | 1 012 | 1 012 | 1 012 |
18 | Maximum total length of columns in a GROUP BY clause (in bytes) | 4 005 | 8 101 | 16 293 | 32 677 |
19 | Maximum number of columns in an ORDER BY clause | 500 | 1 012 | 1 012 | 1 012 |
20 | Maximum total length of columns in an ORDER BY clause (in bytes) | 4 005 | 8 101 | 16 293 | 32 677 |
29 | Most values in an INSERT statement | 500 | 1 012 | 1 012 | 1 012 |
30 | Most SET clauses in a single UPDATE statement | 500 | 1 012 | 1 012 | 1 012 |
45 | Maximum size of a regular DMS table space (in gigabytes) | 64 | 128 | 256 | 512 |