Re: [cx-oracle-users] BULK Insert ?
Brought to you by:
atuining
From: Amaury F. d'A. <ama...@gm...> - 2010-09-21 19:01:11
|
Hi, 2010/9/21 Robert <web...@gm...>: > Given a result set, does cx_oracle provide a way to "bulk insert" the > result set rather than what I'm doing below (one-by-one Inserts) ? > > > ssresult_set = sscursor.fetchall() # This is a pyodbc result set, > same stucture as that of cx_oracle > > if len(ssresult_set) > 0: > try: > for row in ssresult_set: > oracursor2.execute('''insert into ........snip......''', row) Of course! use executemany(): if len(ssresult_set) > 0: oracursor2.executemany('''insert into ........snip......''', ssresult_set) -- Amaury Forgeot d'Arc |