Add Parameters window -- Fields and controls

Parameter name


Parameter name

This one to eight character string will be used for diagnostic messages. If you supply a parameter name, DB2 uses this string to describe the parameter in error messages, rather than the ordinal position of the parameter within the parameter list.

Valid characters are the letters A through Z, the characters 0 through 9, and EBCDIC code points X'5B', X'7B', and X'7C', which display as $, #, and @ if you use code page 37 or 500.

Parameter types

INT A large integer parameter
INTEGER A large integer parameter
SMALLINT A small integer parameter
REAL A single precision floating point parameter
FLOAT A double precision floating point parameter
DOUBLE PRECISION A double precision floating point parameter
DEC A decimal parameter
DECIMAL A decimal parameter
CHAR A fixed-length character string between 1 and 255 characters
CHARACTER A fixed-length character string between 1 and 255 characters
VARCHAR A variable-length character string between 1 and 32765 characters.

Important: Though a VARCHAR parameter can be up to 32765 bytes, a VARCHAR column in a table cannot exceed 32704 bytes. If you update a VARCHAR column with a length greater than 32704, then the column value will be truncated.

GRAPHIC A fixed-length graphic character string between 1 and 127 characters
VARGRAPHIC A variable-length graphic character string between 1 and 16383 graphic characters
BLOB A varying-length string with a maximum length of 2 147 483 824, designed to hold non-traditional data such as pictures, audio, and mixed media.
CLOB A varying-length string with a maximum length of 2 147 483 647 (2 gigabytes minus 1 byte).
DBCLOB A varying length string with a maximum length of 1 073 741 824 double-byte characters. A DBCLOB is designed to store DBCS data.
DATE A three-part value representing year, month, and date, which designates a point in time using the Gregorian calendar.
TIME A three-part value representing hour, minute, and second, which designates a time of day using a 24-hour clock.
TIMESTAMP A seven-part value representing year, month, day, hour, minute, second, and microsecond, which designates a date and time.
ROWID A value that uniquely identifies a row in a table. For more information on row IDs, see the DB2 Application Programming and SQL Guide.

Parameter Characteristics

Length
Specify a value for the length of a parameter.
If you do not specify a length for CHAR, CHARACTER, or GRAPHIC, then length is set to 1. You must specify a length for VARCHAR or VARGRAPHIC.
Precision
Specify a value for the total number of digits in a parameter.
You must specify a value between 1 and 31. If you specify a precision value, then you must also specify a scale value. If you do not specify precision and scale, then precision is set to 5 and scale to zero.
Scale
Specify the number of digits to the right of the decimal point in a parameter.
You must specify a value between 1 and the specified precision value. If you do not specify precision and scale, then precision is set to five and scale to zero.
Data subtype
Specify a character parameter's subtype. Subtype has one of the following values:
SBCS
The parameter holds single-byte data. Character conversion occurs when the parameter passes from a DRDA requester to a DRDA server. This is the default if the install option MIXED DATA is NO.
MIXED
The parameter holds MIXED DATA. You cannot use this option when the install option MIXED DATA is NO. Character conversion occurs when the parameter passes from a DRDA requester to a DRDA server. This is the default if the install option MIXED DATA is YES.
BIT
The parameter holds BIT data. Character conversion does not occur when the parameter passes from a DRDA requester to a DRDA server. This setting is useful when passing large binary strings (such as PC bitmaps) to a stored procedure.
Parameter type
Specify how applications use the value contained in a parameter:
IN
Identifies this parameter as an input-only parameter to the stored procedure. This parameter contains no value when the stored procedure returns control to the calling SQL application.
OUT
Identifies this parameter as an output-only parameter to the stored procedure.
IN/OUT
Identifies this parameter as both an input and output parameter for the stored procedure.