On Wed, May 18, 2011 at 4:10 PM, Petite Abeille
<petite.abei...@gmail.com> wrote:
> On May 18, 2011, at 10:50 PM, Danilo Cicerone wrote:
>> How can I simulate a
>> calendar table(maybe using the strftime funtion)?
>
> Well, you have two broad options:
>
> (1) materialize the calendar as a table
> (2) virtualize the calendar as a generator
>
> The first option is brutal, but simple. E.g. create a table with, say, all 
> the julian date from 20000101 to 21001231 (2451544 to 2488433 JD, about 
> 36,889 records for a century worth of date)
>
> The second option is a bit more involved, but you could have a virtual 
> calendar table that generate the relevant date span on demand:
>
> http://www.sqlite.org/vtab.html
>
> Unfortunately, there is no direct way to generate rows in SQLite as there is, 
> for example, in Oracle or such:

I have a virtual table that allows you to split strings and count
numbers, which could be used as a row generator.  I really want to
polish it off and even, some day, add syntactic sugar (calling this
"table functions"), but lack for time.  Would it help if I posted this
somewhere?

Nico
--
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to