[Zope] db type conversion question

Kevin Littlejohn Kevin Littlejohn <darius@connect.com.au>
Thu, 11 Nov 1999 09:46:29 +1100


In MySQL, numbers will end up as strings if they're bigints.  Change them
to int - that's usually plenty big enough - and the underlying python MySQL
adaptor will stop getting upset.

Test for this, in python with MySQL:

>>> import MySQL
>>> x = MySQL.connect('host','username','password')
>>> x.selectdb('database')
>>> x.listfields('table')

Check the third field of each element in the list you get back - that shows
what the datatype is, if it's 'unhandled', as bigint's appear, then it'll
come back as a string.

KevinL

>>> Sam Gendler wrote
> >
> >
> > what mysql-da are you using?  MySQLdb-0.1.0 has worked for me...
> 
> That is what I am using.
> 
> --sam
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
>           No cross posts or HTML encoding!
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 
> 

--------------- qnevhf@obsu.arg.nh ---------------
Kevin Littlejohn,
Technical Architect, Connect.com.au
Don't let the Govt censor our access to the 'net -
http://www.efa.org.au/Campaigns/stop.html