Re: Problem writing strings to database

[prev] [thread] [next] [Date index for 2004/12/23]

From: Tony Bowden
Subject: Re: Problem writing strings to database
Date: 01:10 on 23 Dec 2004
On Wed, Dec 22, 2004 at 01:18:14PM -0800, cdbi@xxxxxxxxxx.xxx wrote:
> I can consistantly reproduce the problem by removing all data from my
> table.  My code then starts inserting data to the table, and the first
> value is '0', the second is 'NOW_PLAYING' and then I get the error.  Its
> as if Class::DBI sees that value is 0 the first time around, and assumes
> it will always be a number.  (The column is varchar).  So can I somehow
> force Class::DBI to treat my values as strings all the time?

That's a DBI issue, rather than a Class::DBI one. 

AFAIK the only reliable way to get around that is to tell DBI that's
going to be a VARCHAR column, which you can do using the undocumented
column_type() method.  

Tony

Re: Prooblem writing empty strings to mySQL db
Adam Przygienda 09:09 on 22 Dec 2004

Problem writing strings to database
cdbi 21:18 on 22 Dec 2004

Re: Problem writing strings to database
Tony Bowden 01:10 on 23 Dec 2004

Re: Problem writing strings to database
Tony Bowden 09:03 on 23 Dec 2004

Re: Problem writing strings to database
Tim Bunce 15:24 on 23 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52