Skip to Content.
Sympa Menu

freetds - Re: [freetds] "error_handler: Data-conversion resulted in overflow"

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] "error_handler: Data-conversion resulted in overflow"
  • Date: Wed, 27 Sep 2006 23:19:04 -0400

Peter Matulis wrote:
>
> On 9/26/06, James K. Lowden <jklowden AT freetds.org> wrote:
> > Peter Matulis wrote:
> > > I currently have a Linux system successfully performing SELECT
> > > queries on a MS SQL Server 2000 system. However, I notice that
> > > sometimes I get an error:
> > >
> > > "error_handler: Data-conversion resulted in overflow"
> >
> > I think you're trying to convert a BIGINT to a string (possibly
> > implicitly, through binding). The character buffer is not big enough.
> >
> > The conversion function that emits this message returns CS_FAIL. That
> > should be passed back to your application.
>
> Thanks for your reply. I'm using a very simple Perl script using the
> DBI and DBD:Sybase modules. I'm not a programmer and would really
> appreciate detailed guidance on what I should do to fix this. This is
> my script where 'telephone' is the BIGINT:

Ah, I suspected as much. If you don't get a response from Michael
Peppler, you might want to notify him. Perhaps DBD::Sybase has an issue
with BIGINT?

Meanwhile, I encourage you to reconsider your database schema choice.
It's an old rule in databases: choose numeric types only to store numbers:
quantities, amounts, sizes, etc. Things you intend to add up or otherwise
treat as numbers. Otherwise, you get burned when your number-provider
decides letters are OK, or when the leading zero is significant. Or
something else I can't remember off the top of my head.

Besides, telephone numbers aren't numeric. I know, you don't expect to
store 1-800-MATTRESS or Pennsylvania-6-5000, but don't you think you
should be able to?

BIGINT is 8 bytes; North American phone numbers are 10. Spoil yourself
and don't spare the bytes, that's what I'd say.

HTH and regards,

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page