我正在尝试使用以下Python代码从PostgreSQL表中检索内容。但是,代码不断向我发送表头。我的代码有问题吗?
def retrieve_info(parameter, identity_number):
statement = """SELECT %s from "service_reviews_serviceprovider" WHERE identification_number = %s"""
cur.execute(statement, (parameter, identity_number, ))
cur.connection.commit()
result = cur.fetchone()[0]
print(result)
return result