[sqlalchemy] multiple columns in correlated subquery?

2011-05-31 Thread Stephen Emslie
In Oracle, I would like to perform a correlated subquery where multiple columns are specified in the set clause and those columns are selected by the subquery. For example: UPDATE table1 a SET (a.column1, a.column2) = (SELECT b.column1, b.column2 FROM table2 b WHERE a.id=b.id) WHERE

Re: [sqlalchemy] multiple columns in correlated subquery?

2011-05-31 Thread Michael Bayer
This is a completely Oracle-specific syntax I've never seen before, and apparently resembles an UPDATE FROM - ticket #2166 has been updated to see if it can be part of the solution when we implement the more common UPDATE FROM extension. Unfortunately this syntax is not supported. Your

Re: [sqlalchemy] Problem accessing sqlite records w primary keys imported from csv file

2011-05-31 Thread Joel B. Mohler
On Monday, May 30, 2011 11:25:11 pm Michael Bayer wrote: This is a malformed date value. SQLite has no date type so SQLA must parse it. It assumes its only parsing strings that it created. If you're artificially generating strings to be used with DateTime, make sure you put dates in the

Re: [sqlalchemy] Problem accessing sqlite records w primary keys imported from csv file

2011-05-31 Thread Michael Bayer
On May 31, 2011, at 5:07 PM, Joel B. Mohler wrote: On Monday, May 30, 2011 11:25:11 pm Michael Bayer wrote: This is a malformed date value. SQLite has no date type so SQLA must parse it. It assumes its only parsing strings that it created. If you're artificially generating strings to be

[sqlalchemy] finding the dynamic attributes of an instance

2011-05-31 Thread Bill Curtis
If I have an instance, returned from calling first() or one(), etc on a query object ... is there a straightforward way to determine which of its attributes are dynamic queries, as opposed to loaded data? This works: [ getattr(instance, attr) for attr in dir(instance) if isinstance(

Re: [sqlalchemy] Problem accessing sqlite records w primary keys imported from csv file

2011-05-31 Thread Joel B. Mohler
On Tuesday, May 31, 2011 05:42:26 pm Michael Bayer wrote: This is a malformed date value. SQLite has no date type so SQLA must parse it. It assumes its only parsing strings that it created. If you're artificially generating strings to be used with DateTime, make sure you put dates

[sqlalchemy] Retrieving attribute values after error rollback without querying

2011-05-31 Thread chris e
I have a field verification routine that is run as part of a mapper extension. When a field error is detected, an exception is thrown with the field in question, the object with the incorrect field. This worked great in 0.3, but I'm now moving to 0.6, and I can no longer do this as my invalid

Re: [sqlalchemy] Retrieving attribute values after error rollback without querying

2011-05-31 Thread Michael Bayer
On May 31, 2011, at 11:09 PM, chris e wrote: I have a field verification routine that is run as part of a mapper extension. When a field error is detected, an exception is thrown with the field in question, the object with the incorrect field. This worked great in 0.3, but I'm now moving to

[sqlalchemy] Exclusive SELECT?

2011-05-31 Thread thatsanicehatyouhave
Hi, I'm working on a script using SQLAlchemy against a PostgreSQL database and using Python's multiprocessing. The pattern is for each thread to: - start a transaction (session.begin()) - retrieve the next row in table X that has not yet been processed - set a being_processed flag in the row so