I guess so - no special action is required if you store numbers in a varchar field in MySQL, only text (longtext or mediumtext too). Also, the same thing works OK with an Oracle long field.

Robbie

From: Hardy Merrill <[EMAIL PROTECTED]>
To: Robbie Armour <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: Rounding errors storing numbers in MySQL text fields using DBI
Date: Tue, 24 Jun 2003 11:56:24 -0400

Robbie Armour [EMAIL PROTECTED] wrote:
> That's it! - 0.4444 then '0.4444' fails whereas '0.4444', 0.4444 works.
> I shall put something in my code to circumvent this.


Hold on - I realize I'm being thick here, but what does
that prove?  The original problem was that 0.4444 ended
up coming out of MySQL as 0.44, right?  What is the
resolution?

--
Hardy Merrill
Red Hat, Inc.

>
> Thanks for all your help with this.
>
> Robbie
>
> >Once a placeholder has been tagged with a type (number in this case),
> >the type is remembered for the life of the statement.  As a result
> >'0.3333' is pasted into the SQL as if it is a number.
> >To test my theory, please try the following sequences in separate
> >runs:
> >
> >  # Run 1
> >  $qst -> execute( "xyz" );
> >  $qst -> execute( 0.4444 );
> >  $qst -> execute( 0.3333 );
> >
> >  # Run 2
> >  $qst->execute( '0.4444' );
> >  $qst->execute( 0.3333 );
> >
> >--
> >Mac :})
> >Give a hobbit a fish and he eats fish for a day.
> >Give a hobbit a ring and he eats fish for an age.

_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband




Reply via email to