Thank you Mike!
I'm going to try this different approach.
El miércoles, 25 de marzo de 2020, 13:30:47 (UTC+1), Mike Bayer escribió:
>
>
>
> On Wed, Mar 25, 2020, at 6:27 AM, Javier Collado Jiménez wrote:
>
> Hello,
> I'm having a problem trying to cleanup sqlalchemy ob
Hello,
I'm having a problem trying to cleanup sqlalchemy objects. My application
has a thread which handles DB connections. In some cases the thread dies
and I want to do a cleanup so, next time the thread is started it would be
able to reconnect again.
The steps I tried are:
Thank you!
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message
]
there is a commit after every insert
El miércoles, 27 de noviembre de 2019, 19:07:31 (UTC+1), Mike Bayer
escribió:
>
>
>
> On Wed, Nov 27, 2019, at 1:05 PM, Javier Collado Jiménez wrote:
>
> One more thing about returning data. When I insert rows one by one, it
> works:
&
self.cursor.fetchone()
cx_Oracle.InterfaceError: not a query
Is there a way to do a batch insert and recover every rowid?
Thank you!!
El miércoles, 20 de noviembre de 2019, 16:39:36 (UTC+1), Mike Bayer
escribió:
>
>
>
> On Wed, Nov 20, 2019, at 9:05 AM, Javier Collado Jiménez wrote:
>
> He
ause(table, filters)
> statement=table.update().where(whereclause).values(**datum).returning(table.c.rowid)
>
>
>
> Hope that helps,
>
> Simon
>
> On Tue, Nov 26, 2019 at 12:23 PM Javier Collado Jiménez
> > wrote:
> >
> > Is there an easy way
:
>
>
>
> On Wed, Nov 20, 2019, at 9:05 AM, Javier Collado Jiménez wrote:
>
> Hello,
>
> Using ORM, i'm inserting like that:
>
> session.add(table_mapper(**datum))
>
> And updating:
>
> session.query(dest_table).filter_by(**filters).filter(filter_column >
&
Thank you, it worked perfectly!
El miércoles, 20 de noviembre de 2019, 16:39:36 (UTC+1), Mike Bayer
escribió:
>
>
>
> On Wed, Nov 20, 2019, at 9:05 AM, Javier Collado Jiménez wrote:
>
> Hello,
>
> Using ORM, i'm inserting like that:
>
> session.add(table_map
Hello,
Using ORM, i'm inserting like that:
session.add(table_mapper(**datum))
And updating:
session.query(dest_table).filter_by(**filters).filter(filter_column >
from_date).update(datum, synchronize_session=False)
Is there a way to get returning rowid of the rows affected.
I want to keep
> "nopk_2", m,
> Column('q', Integer),
> Column('p', Integer)
> )
>
> # add a new pk constraint, append_constraint knows how to replace
> # an empty pk constraint w/ a non-empty one
> t2.append_constraint(PrimaryKeyConstraint("q", &qu
Hello!
Is there a way to redefine a table in metadata?
I'm trying to define a table without pk to create this way in the database,
and then trying to add the pk to the definition to use it.
But I'm always getting this error
sqlalchemy.exc.ArgumentError: Column object 'column' already assigned to
11 matches
Mail list logo