Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Michael Bayer
Kent wrote: Along the same lines, is there something we can do about nvl() (oracle) versus coalesce() (ansi)? They aren't exactly the same, unfortunately (nvl takes exactly 2 arguments, no more), so maybe there is nothing 'official' you can do, but can you help me work it out for my project?

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Kent Bower
Thanks very much. On 4/2/2010 5:41 PM, Michael Bayer wrote: Kent wrote: Along the same lines, is there something we can do about nvl() (oracle) versus coalesce() (ansi)? They aren't exactly the same, unfortunately (nvl takes exactly 2 arguments, no more), so maybe there is nothing

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Kent Bower
As an aside, more recent Oracles support ansi coalesce, so it is probably more appropriate to only use nvl() for older, non-ansi Oracle versions, but if this is only for illustration then that is not a big deal (unless you don't want people writing to you saying coalesce does support more than

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Michael Bayer
Kent Bower wrote: As an aside, more recent Oracles support ansi coalesce, so it is probably more appropriate to only use nvl() for older, non-ansi Oracle versions, but if this is only for illustration then that is not a big deal (unless you don't want people writing to you saying coalesce

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Ian Kelly
On Fri, Apr 2, 2010 at 3:41 PM, Michael Bayer mike...@zzzcomputing.comwrote: Kent wrote: Along the same lines, is there something we can do about nvl() (oracle) versus coalesce() (ansi)? They aren't exactly the same, unfortunately (nvl takes exactly 2 arguments, no more), so maybe

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Kent Bower
By the way, Unless a ClauseList is subscriptable in 0.6, I had problems the way it was. Here is what I did: @compiles(coalesce, 'oracle') def compile(element, compiler, **kw): sql = nvl(%s) clauses = map(compiler.process, element.clauses) for i in xrange(len(clauses) - 2):

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Michael Bayer
Kent wrote: Any chance you plan to make func.now consider oracle and use_ansi=False (and return sysdate)? the use_ansi flag should be removed as far as public API since we can detect server version now. we can also make now() return sysdate() unconditionally on oracle, you should give us a