[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-19 Thread dhanil anupurath
Hi thanks for the quick reply and pointing me in the right direction. it seems the error is actually related to the operator. is there anything SA can do on this issue? In the meantime i am going to change my query. thanks again.. -- You received this message because you are subscribed to

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-19 Thread Michael Bayer
I'm not familiar with the operator in Oracle or its syntax. The first step would be to create a cx_oracle sample script that emits the exact SQL you're looking for. We could then see how to adapt it to SQLAlchemy. On May 19, 2010, at 2:45 AM, dhanil anupurath wrote: Hi thanks for the

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-18 Thread dhanil anupurath
Hi SORRY for the delay to reply. Here is what my definitions. These are my class and table definitions: class Task(DeclarativeBase): task_id = Column(Integer,Sequence('id_ seq'), primary_key=True) task_type = Column(Unicode(50), default=to_unicode('Task')) name =

[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-18 Thread dhanil anupurath
Hi task = Task(u'Task',\ {'quiet':False}, [], {}, None, u'admin') model.DBSession.merge(task) in my database the following query will try to select the above task object and result in error DBSession.query(TaskCalendar).options(eagerload('task')).\

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-18 Thread Michael Bayer
attached is a test program that is of a format which allows us to be able to answer your questions quickly. It is a short test program that runs fully, using the model fragments you've sent along. It does not reproduce your error. Instead, it appears that the is not an operator accepted

[sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-10 Thread dhanil anupurath
Hi This is my class definition class TaskCalendar(DeclarativeBase): __tablename__ = 'task_calendars1' cal_id = Column(Integer,Sequence('id_seq'), primary_key=True) task_id = Column(Integer, ForeignKey('tasks.task_id')) dow = Column(Integer) month = Column(Integer) day =

Re: [sqlalchemy] Re: Sql alchemy-Oracle Error

2010-05-10 Thread Michael Bayer
This is not enough detail to provide any insight into your issue. We would require the mapping for TaskCalendar, Tasks, as well as code which inserts the offending data into the database and then issues your query, reproducing the error you are getting. On May 10, 2010, at 8:54 AM, dhanil

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-24 Thread Michael Bayer
On May 23, 2008, at 10:02 PM, Brandon Goldfedder wrote: Michael, Yes - that is what I am doing now : ForeignKey(schemaname.tablename.colname) and I have things working. (see example 3). My problem is these steps seem really ugly and a lot more work than it should be to get things

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-24 Thread Brandon Goldfedder
MIchael, Thanks for your help on this - I agree I want to get beyond a mess here regardless if it is 'working' Here are 3 tables that demostrate the issues (with the changes I needed to do use_alter, modify schema.py, hardcode in schema name to ForeignKey and tables). I want the model

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-24 Thread Michael Bayer
thank you , this was an old ticket #709 and is fixed in r4814 of the 0.4 branch and r4813 of trunk. remove the usage of owner, it is synonymous with schema (as it is in oracle itself - http://www.dba-oracle.com/t_schema_components_owner_user.htm ) , as well as all the other hacks. On

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-24 Thread Brandon Goldfedder
Michael, Great - that handles the create_all(checkfirst issue) Any fix for the ix_ table name taking into account Oracle name limits in schema.py? Thx, Brandon On May 24, 7:37 pm, Michael Bayer [EMAIL PROTECTED] wrote: thank you , this was an old ticket #709 and is fixed in r4814 of the   0.4

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-24 Thread Michael Bayer
old bug, I think its #820. we generate a bad name in that case. Try using the schema.Index() or schema.DDL() construct for now as a workaround (I'm not entirely thrilled about the index=True option on Column in general). On May 24, 2008, at 8:20 PM, Brandon Goldfedder wrote:

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-23 Thread Brandon Goldfedder
All, So have a 'working' solution but think it is pretty bad... Someone MUST have a better solution. Here is what I had to do: 1. Have create_all explictly not test for tables existing (or else it finds it in wrong schema) create_all(checkfirst = False) 2. Explictly set the schema and owner

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-23 Thread Michael Bayer
On May 23, 2008, at 3:10 PM, Brandon Goldfedder wrote: All, Perhaps someone can help me here since I am in that 'bad place' where I am retrying things again and getting deeper than I want into it. I am trying to create a database (using elixir model although the problem appears to be in

[sqlalchemy] Re: Problems with Oracle Express/sqlalchemy

2008-05-23 Thread Brandon Goldfedder
Michael, Yes - that is what I am doing now : ForeignKey(schemaname.tablename.colname) and I have things working. (see example 3). My problem is these steps seem really ugly and a lot more work than it should be to get things working portably and reliably - thus my question on if this is best

[sqlalchemy] Re: SA with ORACLE connect

2008-05-15 Thread Michael Bayer
On May 15, 2008, at 3:53 PM, sbhatt wrote: Does anyone know how to write it using SA ? CONNECT BY goes where things like ORDER BY and GROUP BY go, so is not going to work within the WHERE clause. It is as of yet unsupported by the select() construct so you'd have to go with

[sqlalchemy] Re: How are Oracle IDs generated?

2008-02-14 Thread Michael Bayer
On Feb 14, 2008, at 6:01 PM, Waldemar Osuch wrote: On Feb 14, 2:06 pm, Richard Jones [EMAIL PROTECTED] wrote: On Feb 14, 5:13 pm, Waldemar Osuch [EMAIL PROTECTED] wrote: On Feb 13, 8:03 pm, Richard Jones [EMAIL PROTECTED] wrote: Thanks, I should have been clearer: how is ID generation

[sqlalchemy] Re: How are Oracle IDs generated?

2008-02-13 Thread Waldemar Osuch
On Feb 13, 8:03 pm, Richard Jones [EMAIL PROTECTED] wrote: I've tried poking through the documentation and source to determine this, but it's still unclear to me how SQLAlchemy generates IDs for new rows in Oracle. There's support for sequences in the oracle backend, but there don't

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-26 Thread Michael Bayer
On Sep 25, 2007, at 7:30 PM, m h wrote: Have updated the ticket with my fix change the dbapi_type of OracleText from CLOB to NUMBER I'm not sure if this breaks others code the bug is, the type of the bind parameters should be coming out as VARCHAR, not CLOB. NUMBER is

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-26 Thread m h
On 9/26/07, Michael Bayer [EMAIL PROTECTED] wrote: On Sep 25, 2007, at 7:30 PM, m h wrote: Have updated the ticket with my fix change the dbapi_type of OracleText from CLOB to NUMBER I'm not sure if this breaks others code the bug is, the type of the bind parameters

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-25 Thread Michael Bayer
On Sep 24, 2007, at 11:36 PM, m h wrote: 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

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-25 Thread m h
Have updated the ticket with my fix change the dbapi_type of OracleText from CLOB to NUMBER I'm not sure if this breaks others code http://www.sqlalchemy.org/trac/ticket/793 --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-24 Thread m h
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 =

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-24 Thread Michael Bayer
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

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-24 Thread m h
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

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread Michael Bayer
On Sep 21, 2007, at 1:43 PM, m h wrote: Just for kicks I tried using .3.10 and it failed giving the same error that was reported in the Aug 18 thread autoloading Oracle tables with column defaults:: File /home/matt/work/vpython/lib/python2.4/site-packages/

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread Michael Bayer
well the issue is not even the bind params its the result coming back from cx_oracle. its not well documented/consistent which oracle types come back as a LOB and also come back with a cx_oracle LOB object, and which ones do not. its possible that just upgrading your cx_oracle will fix

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread m h
Thanks for the response! On 9/22/07, Michael Bayer [EMAIL PROTECTED] wrote: well the issue is not even the bind params its the result coming back from cx_oracle. Again, I'm confused how this query works from straight cx and .3.7 but fails when .4beta calls it. Could you enlighten me on what

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread m h
I guess to help validate my confusion, in my debugging I replaced the line 867 in base.py:: raise exceptions.DBAPIError.instance(statement, parameters, e) with:: raise Then it doesn't give me the useful statement and parameters, but it tells me exactly where it failed:: ... File

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread Michael Bayer
On Sep 22, 2007, at 3:45 PM, m h wrote: So the failure is when CursorFairy executes the execute method on the cx cursor. Where does the SA converting returned types come into play on this? because you sent me this stack trace: File /home/matt/work/vpython/lib/python2.4/site-packages/

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread m h
Sorry, my mess of emails appears to have confused you (youre looking at the error with .3.10 not .4beta) On 9/22/07, Michael Bayer [EMAIL PROTECTED] wrote: On Sep 22, 2007, at 3:45 PM, m h wrote: So the failure is when CursorFairy executes the execute method on the cx cursor. Where

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread m h
On 9/22/07, Michael Bayer [EMAIL PROTECTED] wrote: so the new error youre getting now puts it back in the execution camp. you need to narrow down the query to the specific column expression and/or parameter thats making it break. Here's a simple query that fails. The deal breaker is the

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread m h
Ok, it's caused by func.to_date. Here's an even simpler testcase. Try to convert a date to a string:: def test2(): start_date = '12/26/03' query = select([func.to_date(cal_dim.c.adwkenddt,'MM/DD/RR')]) compiled = query.compile() result = query.execute() for r in result:

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-22 Thread m h
Disregard this testcase it's late at night no need to convert a date to a date but the previous testcase fails for .4beta and works for .3.7!!! On 9/22/07, m h [EMAIL PROTECTED] wrote: Ok, it's caused by func.to_date. Here's an even simpler testcase. Try to convert a date to a

[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle

2007-09-21 Thread m h
Just for kicks I tried using .3.10 and it failed giving the same error that was reported in the Aug 18 thread autoloading Oracle tables with column defaults:: File /home/matt/work/vpython/lib/python2.4/site-packages/SQLAlchemy-0.3.10-py2.4.egg/sqlalchemy/databases/oracle.py, line 117, in

[sqlalchemy] Re: AS for Oracle

2007-04-14 Thread vkuznet
Thank you Mike, but I'm out of ideas with my problem, the resulting query return non- zero result in sqlplus prompt, but SQLAlchemy return me 0. So, what I'm looking for is number of found rows. SELECT count(DISTINCT tad.name) FROM analysisdataset tad LEFT OUTER JOIN processeddataset tprd ON

[sqlalchemy] Re: AS for Oracle

2007-04-14 Thread vkuznet
Sorry for spam, it's a bug in my program. Thanks for your support and prompt responses. Valentin. On Apr 14, 8:46 pm, vkuznet [EMAIL PROTECTED] wrote: Thank you Mike, but I'm out of ideas with my problem, the resulting query return non- zero result in sqlplus prompt, but SQLAlchemy return