In my application, atables is dynamically created on the schema. I need to insert rows onto that table. I tried to use some of the methods suggested here but then I realized that they are passing the mapped class or the table of the class to the bulk_insert_mappings method or the engine.execute(Customer.__table__.insert() method. In both approaches, Customer is a mapped class. For what I'm doing, the table I'm doing the insert on is dynamically created. So I can't do models.TableName. Is there a way to do bulk inserts on such a table in sqlalchey (orm or core) ?
I tried the "insert all .... select * from dual" construct in oracle but that doesn't work with sequence_name.nextval for the id column. So I'm looking for another approach. I read that since oracle 12c I can create a unique id column using GENERATED AS IDENTITY clause. Is that supported in sqlalchemy? Then I could just insert rows without worrying about how the id is generated. Thanks for sqlalchemy and your continued support.
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Any take on this? I realize it may not be sqlalchemy specific.
Mike,
The table creation part is done. My question is about how to insert rows/data into a table that is dynamically created. This dynamically created table is not represented by a class or anything in sqlalchemy.
I'm just wondering if you know of a nice way to do bulk / mass inserts into such a table without a loop of insert statements. The source of my data is a generator of tuples (coming from openpyxl). Thanks.