Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Datatype conversion for transfer to statements [Table of Contents] Chapter 11 Using
Destination-Template Transfer

Access Service User's Guide DirectConnect for AS/400

[-] Chapter 10 Using Bulk Copy Transfer
[-] Errors from data values

Errors from data values

The following four tables show the values that cause errors for the access service during bulk copy transfer. These tables are divided into the four major groups of input datatypes:

Each table shows the output datatype and the kind of error that can occur.

Character datatype errors

This table uses the following as the source character datatypes:

The following table shows the errors that can occur when the access service converts the preceding character datatypes to those listed in the Open Server and AS/400 Output Datatype column.

In the Output Datatype column of the following four tables, the CS_ prefix is attached to the Open Server datatypes to distinguish them from AS/400 datatypes.

Conversion errors: character to output datatypes

Open Server and AS/400 Output Datatype

Error Condition

CS_CHAR CS_VARCHAR CS_TEXT CS_BINARY CS_VARBINARY CHAR VARCHAR

The source data is longer than the destination column.

CS_BIT

The source value cannot be converted to a number, or the resulting value does not equal 0 or 1.

CS_TINYINT

The source value cannot be converted to a number, or the resulting value is not between 0 and 255.

CS_SMALLINT SMALLINT

The source value cannot be converted to a number, or the resulting value is not between -32,768 and +32,767.

CS_INTEGER INTEGER

The source value cannot be converted to a number, or the resulting value is not between -2,147,483,648 and +2,147,483,647.

CS_DECIMAL DECIMAL

The source value cannot be converted to a number, or the number of digits to the left of the decimal point in the source exceeds the destination decimal's precision minus scale. Digits to the right of the decimal point that exceed the decimal's scale are truncated without error.

REAL FLOAT

The source value cannot be converted to a number, or the resulting value is one of the following:

  • Greater than 7.2E+75

  • Less than -7.2E+75

  • Greater than 0 and less than 5.4E-79

  • Less than 0 and greater than -5.4E-79

CS_REAL CS_FLOAT

The source value cannot be converted to a number, or it is out of range. Because the value range is machine-dependent, see the Adaptive Server documentation for your environment.

CS_MONEY

The source value cannot be converted to a number, or the resulting value is not between -922,337,203,685,477.5807 and +922,337,203,685,477.5807.

CS_MONEY4

The source value cannot be converted to a number, or the resulting value is not between -214,748.3647 and +214,748.3647.

CS_DATE

The source value is not an ISO format (YYYY-MM-DD) date or a valid Adaptive Server date/time string, or the resulting date has a year prior to 1753.

CS_DATETIME4

The source value is not an ISO format (YYYY-MM-DD) date or a valid Adaptive Server date/time string, or the resulting date is not between January 1, 1900, and June 6, 2079.

DATE TIME TIMESTAMP

The source value is not an ISO format date, time or timestamp, or a valid Adaptive Server date/time string.

Numeric datatype errors

This section uses the following as source numeric datatypes:

The following table shows the errors that can occur when the access service converts the preceding source numeric datatypes to those listed in the Open Server and AS/400 Output Datatype column.

Conversion errors: numeric types to output datatypes

Open Server and AS/400 Output Datatype

Error Condition

CS_CHAR CS_VARCHAR CHAR VARCHAR

The destination column is too small to hold the character string to express the value. For example, the source value is 102, and the destination column is CS_CHAR(2).

CS_BIT

The value does not equal 0 or 1.

CS_TINYINT

The value is not between 0 and 255.

CS_SMALLINT SMALLINT

The value is not between -32,768 and +32,767.

CS_INTEGER INTEGER

The value is not between -2,147,483,648 and +2,147,483,647.

CS_DECIMAL DECIMAL

The number of digits to the left of the decimal point in the source exceeds the precision minus scale of the destination decimal. Digits to the right of the decimal point that exceed the decimal's scale are truncated without error.

REAL FLOAT

The source value is one of the following:

  • Greater than 7.2E+75

  • Less than -7.2E+75

  • Greater than 0 and less than 5.4E-79

  • Less than 0 and greater than -5.4E-79

CS_REAL CS_FLOAT

The source value is out of range. Because the value range is machine-dependent, see the Adaptive Server documentation for your environment.

CS_MONEY

The value is not between -922,337,203,685,477.5807 and +922,337,203,685,477.5807.

Because the accuracy of a FLOAT value is 15 digits, a FLOAT value converted to CS_MONEY is accurate only to the nearest dollar.

Because the highest precision of a REAL value is 7 digits, a REAL value converted to CS_MONEY is accurate only to the nearest hundred million dollars.

CS_MONEY4

The value is not between -214,748.3647 and +214,748.3647.

Date datatype errors

This section uses the following as source date datatypes:

The following table shows the errors that can occur when the access service converts the preceding source date datatypes to those listed in the Open Server and AS/400 Output Datatype column.

Conversion errors: date types to output datatypes

Open Server and AS/400 Output Datatype

Error Condition

CS_CHAR CS_VARCHAR CS_TEXT CHAR VARCHAR

When converted into a character string, the date or time value is too long to fit into the destination column.

CS_DATE

The date has a year prior to 1753.

CS_DATETIME4

The date is not between January 1, 1900, and June 6, 2079.

Binary datatype errors

This section uses the following as source binary datatypes:

The following table shows the errors that can occur when the access service converts the preceding source binary datatypes to those listed in the Open Server and AS/400 Output Datatype column.

Conversion errors: binary to output datatypes

Open Server and AS/400 Output Datatype

Error Condition

CS_CHAR CS_VARCHAR CS_TEXT CS_BINARY CS_VARBINARY CS_IMAGE CHAR VARCHAR

The source data is longer than the destination column.


Datatype conversion for transfer to statements [Table of Contents] Chapter 11 Using
Destination-Template Transfer