SQLite has no concept of fixed decimal types. Take a look at
http://www.sqlite.org/datatype3.html for what is supported.

It might be possible to make an effective TypeDecorator using the decimal
module introduced in Python 2.4. In fact that would probably make a good
recipe for the SQLAlchemy wiki. Maybe I'll look at that as an exercise.
-- 
Mike Conley



On Mon, Apr 13, 2009 at 1:27 PM, Michael Bayer <mike...@zzzcomputing.com>wrote:

>
> Its possible that SQLite doesn't respect the "scale" argument.  I'd look
> at the full SQL generated to ensure its what you'd expect, then check
> sqlite's documentation on this.
>
>
> Thomas wrote:
> >
> > Hi,
> >
> > I am a new sqlalchemy user. I'm a bit confused by the behavior of the
> > Numeric data type. Consider the following code:
> >
> > from sqlalchemy import *
> >
> > db = create_engine('sqlite:///test.db')
> > metadata = MetaData()
> > table = Table('thetable',metadata,Column('x',Numeric(scale=3)),Column
> > ('y',Float))
> > metadata.create_all(db)
> >
> > a = 300.155555
> >
> > c = db.connect()
> > c.execute(table.insert(),{'x':a,'y':a})
> > c.close()
> >
> > Now inspecting the database:
> >
> > valinor:sqlalchemy tom$ sqlite3 test.db
> > SQLite version 3.4.0
> > Enter ".help" for instructions
> > sqlite> select * from thetable;
> > 300.155555|300.155555
> >
> > Should the first column not be 300.156 since I specified scale=3? Am I
> > doing something wrong?
> >
> > Thanks for any help,
> >
> > Thomas
> >
> > >
> >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to