Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-06 Thread Mike Bayer
On 10/6/15 3:48 PM, Nana Okyere wrote: > 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. if the table is there you can just

Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-06 Thread Nana Okyere
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

Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-06 Thread Mike Bayer
Have you looked through the general techniques of creating Table objects at http://docs.sqlalchemy.org/en/rel_1_0/core/metadata.html? If you have a list of attribute names, you can programmatically create a Table object from that. On 10/6/15 10:39 AM, Nana Okyere wrote: > Any take on this? I re

Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-06 Thread Nana Okyere
Any take on this? I realize it may not be sqlalchemy specific. -- 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+unsubscr...@googlegroups.com. To post to

Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-03 Thread Nana Okyere
Just a thought. Is there a way to make sqlalchemy 'recognize' my dynamically created table which will allow me to use the bulk_insert_mappings or .__table__.insert() . My application is with flask so I'm using flask-sqlalchemy. If there a way to make sqlalchemy see my created tables like the ta

Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-03 Thread Nana Okyere
Mike, thanks for your response. My original goal is to insert excel rows into a dynamically created oracle table. The library I'm using (openpyxl) gives me all the rows of the excel sheet as a generator. So the generator_name.next() returns a tuple which represents a single row. The elements of

Re: [sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-10-01 Thread Mike Bayer
I would definitely not rely upon new Oracle features like GENERATED AS IDENTITY unless it is absolutely no issue. The SQL you may emit for using NEXTVAL is along the lines of: INSERT INTO table (id, col1, col2, ...) VALUES (my_sequence.nextval, 'data1', 'data2', ...) See the example at http

[sqlalchemy] Bulk inserting rows into a dynamically created table.

2015-09-30 Thread Nana Okyere
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 re