Stored procedure parm limit

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
User avatar
JACK
Member
Posts: 20
Joined: Mon Jan 30, 2006 6:18 am

Stored procedure parm limit

Post by JACK » Wed Oct 11, 2006 2:35 pm

What is the max size we can define for an inparm when calling a stored proc using db2 v7 or 8 ?.


Thanks for help.


Thanks,
Jack.

ovreddy
Member
Posts: 14
Joined: Sat Oct 07, 2006 4:13 pm
Location: Chennai
Contact:

Post by ovreddy » Wed Oct 11, 2006 5:58 pm

Hi Jack,

A stored procedure parameter is also a DB2 Data Type. So the size limit will be same as normal DB2 data types. The following is the summary of data types in DB2.

CHAR[(n)] [FOR BIT DATA]
CHARACTER[(n)] [FOR BIT DATA] 1 to 254 characters

VARCHAR(n) [FOR BIT DATA]
CHARACTER VARYING(n) [FOR BIT DATA]
CHAR VARYING(n) [FOR BIT DATA]

A variable-length character string. The range of n is 1 to 32 672 characters.

LONG VARCHAR [FOR BIT DATA]

A variable-length character string. The maximum length is 32 700 characters.

GRAPHIC[(n)]

A fixed-length graphic string. The range of n is 1 to 127 double-byte characters. When n is not cpecified the default value is 1.

VARGRAPHIC(n)

A variable-length graphic string. The range of n is 1 to 16 336 double-byte characters.

LONG VARGRAPHIC

A variable-length graphic string. The maximum length is 16 350 double-byte characters

BIGINT

An 8-byte integer with a precision of 19 digits. The range of big integers is -9 223 372 036 854 775 808 to +9 223 372 036 854 775 807.

INTEGER
INT

A 4-byte integer with a precision of 10 digits. The range of large integers is -2 147 483 648 to +2 147 483 647.

SMALLINT

A 2-byte integer with a precision of 5 digits. The range is -32 768 to 32 767.

DECIMAL[(p[,s])]
DEC[(p[,s])]
NUMERIC[(p[,s])]
NUM[(p[,s])]

A packed decimal number with an implicit decimal point. The position of the decimal point is determined by the precision (p) and the scale (s) of the number.

The p specifies the total number of the digits. The range of the precision is 1 to 31 digits.

The s is the number of digits in the fractional part of the number. It cannot be negative or greater than the precision. The range of scale is 0 to the precision of the number.

If p is omitted, the default is 5.

If s is omitted the default is 0, that is, values will have no decimal point or fractional part.

The range of a decimal variable or the numbers in a decimal column is -n to +n, where the absolute value of n is the largest number that can be represented with the applicable precision and scale. The maximum range is -10^31+1 to 10^31-1.

FLOAT, REAL and DOUBLE
FLOAT[(n)]

FLOAT data type is used to store single-precision and double-precision floating-point numbers.

A single-precision floating-point number is a 32-bit approximation of a real number. The number can be zero or can range from -3.402E+38 to -1.175E-37, or from 1.175E-37 to 3.402E+38. The range of n is 1 to 24. IBM DB2 internally represents the single-precision FLOAT data type as the REAL data type.

A double-precision floating-point number is a 64-bit approximation of a real number. The number can be zero or can range from -1.79769E+308 to -2.225E-307, or from 2.225E-307 to 1.79769E+308. The range of n is 25 to 53. IBM DB2 internally represents thedouble-precision FLOAT data type as the DOUBLE [PRECISION] data type.

If n is not specified the default value is 53.

REAL

A single-precision floating-point number.

DOUBLE [PRECISION]

A double-precision floating-point number

DATE, TIME and TIMESTAMP
DATE

The DATE data type stores the date information (year, month, day). The supported range is January 1, 0001 to December 31, 9999.

TIME

The TIME data type stores the time information (hours, minutes, seconds). The supported range is 00 hours 00 minutes 00 seconds to 24 hours 00 minutes 00 seconds.

If the hour is 24, the minute and second specifications are zero.

TIMESTAMP

The TIMESTAMP data type stores the date and time information (year, month, day, hour, minute, second, and microsecond). The supported range is January 1, 0001 00 hours 00 minutes 00 seconds 000000 microseconds to December 31, 9999 24 hours 00 minutes 00 seconds 000000 microseconds
BLOB, CLOB and DBCLOB
BLOB(n[K|M|G])

A BLOB (binary large object) is a variable-length binary string that can be up to 2 gigabytes (2 147 483 647 bytes) long.

If only n by itself is specified, the value of n is the maximum length. If K, M or G is specified the maximum length is 1 024, 1 048 576 or 1 073 741 824 times n, and the maximum value for n is 2 097 152, 2 048 or 2, respectively.

Binary large objects are used to hold data, such as pictures, video and audio. Like FOR BIT DATA character strings, BLOB strings are not associated with a code page.

CLOB(n[K|M|G])

A CLOB (character large object) is a variable-length character string that can be up to 2 gigabytes (2 147 483 647 bytes) long. If the length is zero, the value is called the empty string. This value should not be confused with the null value.

If only n by itself is specified, the value of n is the maximum length. If K, M or G is specified the maximum length is 1 024, 1 048 576 or 1 073 741 824 times n, and the maximum value for n is 2 097 152, 2 048 or 2, respectively.

Character large objects are used to store large SBCS's (single-byte character sets) character-based data such as formatted text, HTML and XML documents.

DBCLOB(n[K|M|G])

A DBCLOB (double-byte character large object) is a variable-length graphic string of double-byte characters that can be up to 1 073 741 823 characters long.

If only n by itself is specified, the value of n is the maximum length. If K, M or G is specified the maximum length is 1 024, 1 048 576 or 1 073 741 824 times n, and the maximum value for n is 1 048 576, 1 024 or 1, respectively.

Double-byte character large objects are used to store large DBCS's (double-byte character sets) character-based data.

DATALINK

A DATALINK value is a character string, which references an object stored external to a database. The DATALINK values encode the file and the filename in terms of a Uniform Resource Locator (URL).

A URL is a text string of the general format:

Thanks,
Reddy

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others