[sqlalchemy] Re: Sql alchemy-Oracle Error
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 the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] Re: Sql alchemy-Oracle Error
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 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 the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] Re: Sql alchemy-Oracle Error
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 = Column(Unicode(256)) entity_id = Column(Unicode(256)) entity_name = Column(Unicode(50)) context = Column(PickleType) params = Column(PickleType) kw_params = Column(PickleType) processors = Column(ImmutablePickleType) 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 = Column(Integer) hour = Column(Integer) minute = Column(Integer) task = relation(Task, backref=backref('calendar') _tablename_=tasks TASK_ID Number TASK_TYPEVarchar2 NAME Varchar2 ENTITY_IDVarchar2 ENTITY_NAME Varchar2 CONTEXT Blob PARAMS Blob KW_PARAMSBlob PROCESSORS Blob task = relation(Task, backref=backref('calendar')) This is the query what am trying to do. tasks=DBSession..query(TaskCalendar).options(eagerload('task')).\ filter((TaskCalendar.dow == 0) |\ TaskCalendar.dow.op('')(1 now[6]) 0) (3)SELECT task_calendars.cal_id AS task_calendars_cal_id, task_calendars.task_id AS task_calendars_task_id, task_calendars.dow AS task_calendars_dow, task_calendars.month AS task_calendars_month, task_calendars.day AS task_calendars_day, task_calendars.hour AS task_calendars_hour, task_calendars.minute AS task_calendars_minute, tasks_1.task_id AS tasks_1_task_id, tasks_1.task_type AS tasks_1_task_type, tasks_1.name AS tasks_1_name, tasks_1.entity_id AS tasks_1_entity_id, tasks_1.entity_name AS tasks_1_entity_name, tasks_1.context AS tasks_1_context, tasks_1.params AS tasks_1_params, tasks_1.kw_params AS tasks_1_kw_params, tasks_1.processors AS tasks_1_processors, tasks_1.user_name AS tasks_1_user_name, tasks_1.submitted_on AS tasks_1_submitted_on, tasks_1.repeating AS tasks_1_repeating FROM task_calendars LEFT OUTER JOIN tasks tasks_1 ON tasks_1.task_id = task_calendars.task_id I have the Blob error with thease ORA-00932: inconsistent datatypes: expected NUMBER got BLOB HELP ME TO FIX THESE PROBLEM THANKS -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
[sqlalchemy] Re: Sql alchemy-Oracle Error
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')).\ filter((TaskCalendar.dow == 0) |\ TaskCalendar.dow.op('')(1 now[6]) 0).filter(TaskCalendar.task_id == 19).all() thanks -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] Re: Sql alchemy-Oracle Error
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 by Oracle. Removing the reference to '' allows the program to complete successfully with both 0.6 and 0.5.8, and there is no issue with BLOB/pickletype. If you can modify this attached script to reproduce your issue, that would communicate to us what the problem is. OTOH if this script itself fails without changes, then something is up with your environment or cx_oracle install. On May 18, 2010, at 5:29 AM, dhanil anupurath wrote: 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 = Column(Unicode(256)) entity_id = Column(Unicode(256)) entity_name = Column(Unicode(50)) context = Column(PickleType) params = Column(PickleType) kw_params = Column(PickleType) processors = Column(ImmutablePickleType) 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 = Column(Integer) hour = Column(Integer) minute = Column(Integer) task = relation(Task, backref=backref('calendar') _tablename_=tasks TASK_ID Number TASK_TYPEVarchar2 NAME Varchar2 ENTITY_IDVarchar2 ENTITY_NAME Varchar2 CONTEXT Blob PARAMS Blob KW_PARAMSBlob PROCESSORS Blob task = relation(Task, backref=backref('calendar')) This is the query what am trying to do. tasks=DBSession..query(TaskCalendar).options(eagerload('task')).\ filter((TaskCalendar.dow == 0) |\ TaskCalendar.dow.op('')(1 now[6]) 0) (3)SELECT task_calendars.cal_id AS task_calendars_cal_id, task_calendars.task_id AS task_calendars_task_id, task_calendars.dow AS task_calendars_dow, task_calendars.month AS task_calendars_month, task_calendars.day AS task_calendars_day, task_calendars.hour AS task_calendars_hour, task_calendars.minute AS task_calendars_minute, tasks_1.task_id AS tasks_1_task_id, tasks_1.task_type AS tasks_1_task_type, tasks_1.name AS tasks_1_name, tasks_1.entity_id AS tasks_1_entity_id, tasks_1.entity_name AS tasks_1_entity_name, tasks_1.context AS tasks_1_context, tasks_1.params AS tasks_1_params, tasks_1.kw_params AS tasks_1_kw_params, tasks_1.processors AS tasks_1_processors, tasks_1.user_name AS tasks_1_user_name, tasks_1.submitted_on AS tasks_1_submitted_on, tasks_1.repeating AS tasks_1_repeating FROM task_calendars LEFT OUTER JOIN tasks tasks_1 ON tasks_1.task_id = task_calendars.task_id I have the Blob error with thease ORA-00932: inconsistent datatypes: expected NUMBER got BLOB HELP ME TO FIX THESE PROBLEM THANKS -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. On May 18, 2010, at 5:29 AM, dhanil anupurath wrote: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 = Column(Unicode(256)) entity_id = Column(Unicode(256)) entity_name = Column(Unicode(50)) context = Column(PickleType) params = Column(PickleType) kw_params = Column(PickleType) processors = Column(ImmutablePickleType)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 =
[sqlalchemy] Re: Sql alchemy-Oracle Error
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 = Column(Integer) hour = Column(Integer) minute = Column(Integer) task = relation(Task, backref=backref('calendar')) This is what am trying to do tasks=DBSession.query(TaskCalendar).options(eagerload('task')) The query is as follows SELECT task_calendars1.cal_id AS task_calendars1_cal_id, task_calendars1.task_id AS task_calendars1_task_id,tasks_1.name AS tasks_1_name, tasks_1.entity_id AS tasks_1_entity_id, tasks_1.entity_name AS tasks_1_entity_name, tasks_1.context AS tasks_1_context FROM task_calendars1 LEFT OUTER JOIN tasks tasks_1 ON tasks_1.task_id = task_calendars1.task_id if i remove tasks_1.context this query works fine context column is of pickletype datatype in class and Blob in Database This is the error message: ORA-00932: inconsistent datatypes: expected NUMBER got BLOB Thankful for any suggestions -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
Re: [sqlalchemy] Re: Sql alchemy-Oracle Error
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 anupurath wrote: 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 = Column(Integer) hour = Column(Integer) minute = Column(Integer) task = relation(Task, backref=backref('calendar')) This is what am trying to do tasks=DBSession.query(TaskCalendar).options(eagerload('task')) The query is as follows SELECT task_calendars1.cal_id AS task_calendars1_cal_id, task_calendars1.task_id AS task_calendars1_task_id,tasks_1.name AS tasks_1_name, tasks_1.entity_id AS tasks_1_entity_id, tasks_1.entity_name AS tasks_1_entity_name, tasks_1.context AS tasks_1_context FROM task_calendars1 LEFT OUTER JOIN tasks tasks_1 ON tasks_1.task_id = task_calendars1.task_id if i remove tasks_1.context this query works fine context column is of pickletype datatype in class and Blob in Database This is the error message: ORA-00932: inconsistent datatypes: expected NUMBER got BLOB Thankful for any suggestions -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.