我尝试重建此功能
def getElementArea(screen_area, element):
db = postgresql.open(db_conf.connectionString())
sql = "select " + element + " from screen_coordinates where screen_area = $1 and active = 1"
data = db.query.first(sql, int(screen_area))
return data
收件人
def getElementArea(screen_area, element):
db = postgresql.open(db_conf.connectionString())
sql = "select $2 from screen_coordinates where screen_area = $1 and active = 1"
data = db.query.first(sql, int(screen_area), element)
return data
但是有错误-无法确定参数$ 2的数据类型。如何解决?我使用py-postgresql