NP, I know Oracle is a drag.... but that's what the client has.
Perhaps if you could clarify why I'm confused I might be able to help
debug.  (I've stepped through expression.py all day long).  I feel
like I just need a little hint or push in the right direction.

Eventually you get to a cx cursor and call execute with the statement
on it.  How does the same statement/parameter combo fail with SQL
generate, yet succeed using `text` or plain cx?  If I can get over
that hump, I think I might be able to give you a patch.

On 9/24/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> sorry, i havent forgotten you.  just  have to get the time to power
> up my oracle box.  thanks for putting in the ticket.
>
>
>
> On Sep 24, 2007, at 7:22 PM, m h wrote:
>
> >
> > Here's another simple testcase that fails for Oracle beta5 but works
> > with 0.3.7.  It's about the simplest query I can come up with.  Have a
> > table with a date column in it and query against it using the
> > "to_date" function.
> >
> > def test_to_date():
> >     start_date = '10/05/04'
> >     where = cal_dim.c.adwkenddt == func.to_date(start_date,'MM/DD/RR')
> >
> >     query = select([cal_dim.c.adwkenddt],
> >                    whereclause=where
> >                    )
> >
> >     result = query.execute()
> >     for r in result:
> >         print r
> >
> > This fails for beta5, works for .3.7.  The error is::
> > Traceback (most recent call last):
> >   File "s4.py", line 88, in ?
> >     test_to_date()
> >   File "s4.py", line 59, in test_to_date
> >     result = query.execute()
> >   File "/home/matt/work/vpython/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/sql/expression.py",
> > line 973, in execute
> >     return compiled.execute(*multiparams, **params)
> >   File "/home/matt/work/vpython/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/engine/base.py",
> > line 488, in execute
> >     return e._execute_compiled(self, multiparams, params)
> >   File "/home/matt/work/vpython/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/engine/base.py",
> > line 1121, in _execute_compiled
> >     return connection._execute_compiled(compiled, multiparams, params)
> >   File "/home/matt/work/vpython/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/engine/base.py",
> > line 832, in _execute_compiled
> >     self.__execute_raw(context)
> >   File "/home/matt/work/vpython/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/engine/base.py",
> > line 850, in __execute_raw
> >     self._cursor_execute(context.cursor, context.statement,
> > parameters, context=context)
> >   File "/home/matt/work/vpython/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0beta5-py2.4.egg/sqlalchemy/engine/base.py",
> > line 867, in _cursor_execute
> >     raise exceptions.DBAPIError.instance(statement, parameters, e)
> > sqlalchemy.exceptions.DatabaseError: (DatabaseError) ORA-00932:
> > inconsistent datatypes: expected NUMBER got CLOB
> >  'SELECT "AD_WEEK_CALENDAR_DIM".adwkenddt \nFROM
> > "AD_WEEK_CALENDAR_DIM" \nWHERE "AD_WEEK_CALENDAR_DIM".adwkenddt =
> > to_date(:to_date, :to_date_1)' {'to_date_1': 'MM/DD/RR', 'to_date':
> > '10/05/04'}
> >
> > Am still confused as to the problem here....  I run the same query
> > through text and it works::
> >
> > def test_to_date_text():
> >     s = text("""SELECT "AD_WEEK_CALENDAR_DIM".adwkenddt
> >     FROM "AD_WEEK_CALENDAR_DIM"
> >     WHERE "AD_WEEK_CALENDAR_DIM".adwkenddt = to_date
> > (:to_date, :to_date_1)""")
> >     result = connection.execute(s,
> >                                 to_date_1= 'MM/DD/RR',
> >                                 to_date= '10/05/04')
> >     for r in result:
> >         print r
> >
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to