python - How to execute multiple SQL statements at once
習慣沉默
習慣沉默 2017-05-25 15:08:08
0
1
2038

Suppose there are multiple statements like this:

select T_JGDM_20160811.JJLX from T_JGDM_20160811 where rownum < 30;
select T_JGDM.JJLX from T_JGDM where rownum < 30;
...

We can summarize it into the format of select xxx from yyy, how to execute multiple such statements at one time in Python, where xxx and yyy are variable.

習慣沉默
習慣沉默

reply all(1)
给我你的怀抱

You can extract xxx and yyy as variables

pram = [
    (1111, 2222),
    (2222, 3333)
    ...(自己补充)
]
for table, db in pram:
    sql = 'select %s from %s' % (table, db)
    print sql # 此处自行替换具体代码
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template