chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Big integers as statement parameters in sql-de-lite


From: Kon Lovett
Subject: Re: [Chicken-users] Big integers as statement parameters in sql-de-lite
Date: Mon, 22 Jul 2013 15:34:13 -0700

On Jul 22, 2013, at 3:26 PM, Matt Gushee <address@hidden> wrote:

> Hi, chickenists--
> 
> I am working on an application that stores data in a SQLite3 database,
> and am currently using the sql-de-lite egg to interface with the DB. I
> have a few fields that represent dates, and I have defined their
> datatype as INTEGER.
> 
> However, when I attempt to execute a statement such as:
> 
>  INSERT INTO articles (node_id, title, created_dt) VALUES (?, ?, ?);
> 
> with one of these large integers bound to the third parameter, I get
> an error because apparently the value is too large. The values in
> question are obtained in the following manner:
> 
>  (time->seconds (date->time SRFI-19-DATE-OBJECT))
> 
> ... so a typical result is a number like 1291678156, which is a bignum.
> 
> Is there a way I can use these numbers as numbers in sql-de-lite, or
> do I have to convert them to something else?

(SQLite3 does have datetime functions for use in queries but assumes a string 
or UNIX timestamp.)

Do you need the range a SRFI-19 datetime provides? Maybe an epoch based 
approach, like provided by the posix module.

> 
> --
> Matt Gushee
> 
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]