Revision 2789
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
467 | 467 |
version = int(version)+1 |
468 | 468 |
return sql_gen.add_suffix(name, '#'+str(version)) |
469 | 469 |
|
470 |
def run_query_into(db, query, params=None, into=None, add_indexes_=False, |
|
471 |
**kw_args): |
|
470 |
def run_query_into(db, query, into=None, add_indexes_=False, **kw_args): |
|
472 | 471 |
'''Outputs a query to a temp table. |
473 | 472 |
For params, see run_query(). |
474 | 473 |
''' |
475 |
if into == None: return run_query(db, query, params, **kw_args)
|
|
474 |
if into == None: return run_query(db, query, **kw_args) |
|
476 | 475 |
else: # place rows in temp table |
477 | 476 |
assert isinstance(into, sql_gen.Table) |
478 | 477 |
|
... | ... | |
490 | 489 |
create_query += ' TABLE '+into.to_str(db)+' AS\n'+query |
491 | 490 |
|
492 | 491 |
try: |
493 |
cur = run_query(db, create_query, params, **kw_args)
|
|
492 |
cur = run_query(db, create_query, **kw_args) |
|
494 | 493 |
# CREATE TABLE AS sets rowcount to # rows in query |
495 | 494 |
break |
496 | 495 |
except DuplicateTableException, e: |
... | ... | |
662 | 661 |
cacheable = kw_args.pop('cacheable', True) |
663 | 662 |
log_level = kw_args.pop('log_level', 2) |
664 | 663 |
|
665 |
return run_query_into(db, mk_insert_select(db, *args, **kw_args), [], into,
|
|
664 |
return run_query_into(db, mk_insert_select(db, *args, **kw_args), into, |
|
666 | 665 |
recover=recover, cacheable=cacheable, log_level=log_level) |
667 | 666 |
|
668 | 667 |
default = sql_gen.default # tells insert() to use the default value for a column |
Also available in: Unified diff
sql.py: run_query_into(): Removed no longer used params parameter