在使用 boto 从 MySQL Aurora 数据库中获取数据时,它总是为表中不包含任何值或包含 NULL 值的字段返回True值。
rds_client = boto3.client("rds-data")
emp_id_param = {
"name": "emp_id",
"value": {"longValue": 123}
}
sql = "select * from employee where employee_id = :emp_id"
# Querying the data
result_set = rds_client.execute_statement(
resourceArn=cluster_arn,
includeResultMetadata=True,
secretArn=secret_arn,
database=db_name,
sql=sql,
parameters=[emp_id_param],
)
执行此查询后,我总是得到未存储数据的字段的“真实”值。有谁知道我怎样才能得到“空”值作为响应而不是“真”值。