340 temporary table (on-the-fly if possible, eg for the system |
340 temporary table (on-the-fly if possible, eg for the system |
341 source whose the given cursor come from). If not possible, |
341 source whose the given cursor come from). If not possible, |
342 inserts all data by calling .executemany(). |
342 inserts all data by calling .executemany(). |
343 """ |
343 """ |
344 assert dbg_st_search( |
344 assert dbg_st_search( |
345 uri, union, varmap, args, |
345 self.uri, union, varmap, args, |
346 prefix='ON THE FLY temp data insertion into %s from' % table) |
346 prefix='ON THE FLY temp data insertion into %s from' % table) |
347 # generate sql queries if we are able to do so |
347 # generate sql queries if we are able to do so |
348 sql, query_args = self._rql_sqlgen.generate(union, args, varmap) |
348 sql, query_args = self._rql_sqlgen.generate(union, args, varmap) |
349 query = 'INSERT INTO %s %s' % (table, sql.encode(self.encoding)) |
349 query = 'INSERT INTO %s %s' % (table, sql.encode(self.encoding)) |
350 self.doexec(session, query, self.merge_args(args, query_args)) |
350 self.doexec(session, query, self.merge_args(args, query_args)) |