[sqlalchemy] extended use of VALUES command

2010-03-02 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. Is it possible, in SQLAlchemy, to express this query? CREATE TEMP TABLE foo ( x INTEGER, y INTEGER ); INSERT INTO foo VALUES (10, 11); INSERT INTO foo VALUES (1, 2); manlio= SELECT * FROM foo WHERE (x, y) in (VALUES (1, 2), (3, 4)); x

RE: [sqlalchemy] extended use of VALUES command

2010-03-02 Thread King Simon-NFHD78
Manlio Perillo wrote: Hi. Is it possible, in SQLAlchemy, to express this query? CREATE TEMP TABLE foo ( x INTEGER, y INTEGER ); INSERT INTO foo VALUES (10, 11); INSERT INTO foo VALUES (1, 2); manlio= SELECT * FROM foo WHERE (x, y) in (VALUES (1, 2), (3, 4)); x | y -

[sqlalchemy] How to cache SQLAlchemy results?

2010-03-02 Thread Boda Cydo
Hello, I have a problem that I don't know how to approach. Here it is: Suppose I have a mapped class `Article` and I have a mapped class `Author`. `Article.author` is a relation on `Author` that returns the author of the `Article`. How do I make `Article.author` to cache the value in memcached?

Re: [sqlalchemy] How to cache SQLAlchemy results?

2010-03-02 Thread Michael Bayer
Boda Cydo wrote: Hello, I have a problem that I don't know how to approach. Here it is: Suppose I have a mapped class `Article` and I have a mapped class `Author`. `Article.author` is a relation on `Author` that returns the author of the `Article`. How do I make `Article.author` to cache

Re: [sqlalchemy] oracle insert problem

2010-03-02 Thread Michael Bayer
read the note about case sensitivity in http://www.sqlalchemy.org/docs/reference/dialects/oracle.html?highlight=oracle#identifier-casing celord wrote: Hello guys, I have the table on an oracle db: SQL desc MANPUSHMAIL.PUSHMAIL; Nombre¿Nulo? Tipo

[sqlalchemy] behavior of clear_mapper() function

2010-03-02 Thread Tony Tan
there is something really wired about orm.clear_mappers() function. here is what i did: 1. I used a mapper to add an instance to a session, i.e session.add(instance) 2. use clear_mappers() to clear all existing mapper 3. define another mapper using mapper(), including a 1:N relationship in it.

Re: [sqlalchemy] behavior of clear_mapper() function

2010-03-02 Thread Michael Bayer
Tony Tan wrote: there is something really wired about orm.clear_mappers() function. here is what i did: 1. I used a mapper to add an instance to a session, i.e session.add(instance) 2. use clear_mappers() to clear all existing mapper 3. define another mapper using mapper(), including a

[sqlalchemy] Re: oracle insert problem

2010-03-02 Thread celord
Thanks Michael, I have changed all UPERCASE to lowercase http://www.pastebin.org/100149, the output has changed a bit but the table name is still quoted and the insert does not work sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-00942: table or view does not exist 'INSERT INTO

Re: [sqlalchemy] Re: oracle insert problem

2010-03-02 Thread Michael Bayer
additionally don't shove a schema/owner name into your table's name field. Use the schema kw arg for that. On Mar 2, 2010, at 4:23 PM, celord wrote: Thanks Michael, I have changed all UPERCASE to lowercase http://www.pastebin.org/100149, the output has changed a bit but the table name is