0
dblist = ('database1', 'database2', 'database3', 'database4', 'database5', 'database6', 'database7') 
for db in dblist:
    cursor = conn.cursor()
    cursor.execute("select SYSTEM from automation/awdclient where db = " + "'" + db + "'" + "")
    for row in cursor:
        activesystem.db = row[0]
    cursor.close
    conn.close
print activesystem.database1
print activesystem.database2

我正在做的是从数据库中检索系统名称。我想分配一个等于该系统名称的变量,变量名称为 system.whatever db 字符串。

4

1 回答 1

0

利用:

activesystem.setattr(db, row[0])
于 2013-09-30T18:15:50.523 回答