Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100262 > unrolled thread

Re: Problem with sqlite3 and Decimal (fwd)

Started by"Frank Millman" <frank@chagford.com>
First post2015-12-11 16:27 +0200
Last post2015-12-11 16:27 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Problem with sqlite3 and Decimal (fwd) "Frank Millman" <frank@chagford.com> - 2015-12-11 16:27 +0200

#100262 — Re: Problem with sqlite3 and Decimal (fwd)

From"Frank Millman" <frank@chagford.com>
Date2015-12-11 16:27 +0200
SubjectRe: Problem with sqlite3 and Decimal (fwd)
Message-ID<mailman.139.1449844062.12405.python-list@python.org>
"Igor Korot"  wrote in message 
news:CA+FnnTyaLLEsYGU7v2BreySDOQ1rVsMzJ=5f4iQTLW3=tn=E+Q@mail.gmail.com...

> Hi,
>
> > To: python-list@python.org
> > From: "Frank Millman" <frank@chagford.com>
> > Subject: Problem with sqlite3 and Decimal
> > Date: Fri, 11 Dec 2015 11:21:53 +0200
> > Lines: 71
> >
> > Hi all
> >
> > I need to store Decimal objects in a sqlite3 database, using Python 3.4 
> > on
> > Windows 7.
> >
[...]
>
> >
> > I noticed one oddity - I am asking sqlite3 to store the value as a 
> > string,
> > but then I am asking it to perform arithmetic on it.
>
> Is there a reason you are saving it as the string?
> What happens when you save it as decimal?
>

Well, maybe you know something that I don't, but my understanding is that 
sqlite3 has a very limited range of supported data types, and decimal is not 
one of them.

The stackoverflow article explains how to emulate a decimal type, and it 
works well most of the time.

I found that I could reproduce the problem using sqlite3 directly, without 
using Python, so I have sent a post to the sqlite3 mailing list. I will 
report back with any info received.

Frank

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web