I know this is an old thread, but there isn't much on the web around 
generate_series and SQLA, so I thought I might revive it.

One of the suggestion was to use:

s = func.generate_series(4,5,6).alias(cols=['a'])

select([func.current_date() + s.c.a])

Unfortunately, alias doesn't take a `cols` argument. What's the correct 
syntax with a more contemporary version of SQLA (>= 0.9)?

On Sunday, April 27, 2008 2:40:35 AM UTC+10, Michael Bayer wrote:
>
> OK r4566 of trunk also allows text() within select_from(), so you can  
> use textual  bind params (denoted by a colon ':'):
>
> generate_series = text("generate_series(:x, :y, :z) as s(a)")
>
> s = select([(func.current_date() +  
> literal_column("s.a")).label("dates")]).select_from(generate_series)
>
> # load up some parameters:
>
> s = s.params(x=5, y=6, z=7)
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to