This script lock in the update statement following select for update:
eng=sqlalchemy.create_engine('postgres://x.loc/db')
metadata=sqlalchemy.MetaData()
metadata.bind=eng
tab1 = Table('tab1', metadata, autoload=True)
a_rec =
tab1.select( for_update=True
Sorry. I speak english in rare occasions.
No.
It is not an insert into a join.
The result of a join between tables A and B is the VALUES partial set
for an insert into table C.
sql = A.join(B).select(A.c.id == an_id, fold_equivalents=True,
use_labels=False)
rec = sql.execute().fetchone()
no more correspond to the originals
and then
to the table C columns labels.
I am new to sqlalchemy.
Is there a better solution ?
Can I avoid fold_equivalents in this case?
Thanks!
Marco Vaccari
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group
Opsss!
dict(zip(record.keys(), record.items())
must be
dict(record.items())
On 19 Mar, 16:23, marco vaccari agat...@gmail.com wrote:
Consider 3 tables A,B,C
A JOIN B ON A.id = B.id
produce all the columns required for an insert into C.
I can write:
C.insert().values(dict(zip(record.keys