Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Supplying input parameters for routines

When you assign values to the input parameters for the routine in a CALL statement (procedure call) or when a User Defined Function (UDF) is called, data-type-specific rules apply. These are described below.

Strings

You can assign an alphanumeric value to an input parameter with the alphanumeric data type or a national value to an input parameter with a national data type. The following rules apply:

  • If the target data type is CHAR or NCHAR and the length of the value is smaller than the length of the target data type, the value is padded on the right with blanks.

  • If the target data type is CHAR or NCHAR and the length of the value is greater than the length of the target data type, the value is truncated from the right to the length of the target data type. If characters are removed that are not blanks, the value is not entered and an error message is issued.

  • If the target data type is VARCHAR or NVARCHAR and the length of the value is greater than the maximum length of the target data type, the value is truncated from the right to the maximum length of the target data type. If characters are removed that are not blanks, the value is not entered and an error message is issued.

Numeric values

You can assign a numeric value to an input parameter with a numeric data type. If the numeric data types are not the same, the value is converted to the data type of the input parameter. The following rules apply:

  • If the number of digits to the right of the decimal point of the value is too large for the data type of the input parameter, the value is rounded.

  • If the value is too large for the data type of the input parameter, the value is not entered and an error message is issued.

Time values

You can only assign a time value to an input parameter with the same data type:

  • a date in an input parameter with the data type DATE

  • a time for an input parameter with the data type TIME

  • a time stamp in an input parameter with the data type TIMESTAMP