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

Error 259 [Table of Contents] Error 266

Troubleshooting and Error Messages Guide

[-] Chapter 3 Error Message Writeups
[-] Sequencer Errors
[-] Error 265

Error 265

Severity

16

Error message text

Insufficient result space for %S_MSG conversion of %s value '%s' to a %s field.

Explanation

Error 265 can be raised in the following situations:

Examples and corrective action are provided in the next section.

Action

The following sections describe some scenarios under which Error 265 occurs and ways of dealing with those situations.

Errors in Integer Conversion

Conversions of integer to character data will fail if the target format is not large enough to accommodate the data:

1> select convert (char(1), 500) 
2> go
Msg 265, Level 16, State 1:
Server 'mfg1', Line 1:
Insufficient result space for explicit conversion of 
INT value '500' to a CHAR field.

To correct this problem, choose a larger target format (char(3) in the example).

Errors in Floating Point Conversion

Conversions of floating point to character data will fail if the target format is not large enough to accommodate the data:

1> select convert (char(10), 3.1415e) 
2> go
Msg 265, Level 16, State 1:
Server 'mfg1', Line 1:
Insufficient result space for explicit conversion of 
FLOAT value '3.1415000000000002' to a CHAR field.

As in this example, the trailing part of the source value reported in the error message can be different from the entered value. This is because FLOAT is an approximate numeric datatype whose internal representation (and rounding upon display) are platform-dependent.

To correct this problem, choose a larger target format for display. Use the str function to determine the necessary format. The required format varies depending upon the number being converted and the accuracy of floating point numbers supported by your platform. To guarantee success, use a target of 25 characters.

If loss of precision (rather than display format) is a concern in the application, consider using an exact numeric datatype such as integer, numeric or decimal.

Additional information

Refer to the Transact-SQL User's Guide for information about the str function.

Versions in which this error is raised

All versions


Error 259 [Table of Contents] Error 266