这是关于从参数化查询中获取数据的follow up question。考虑以下代码:
const char *neo4j_query = "MATCH (p:Person) WHERE p.age > {age} RETURN p.name AS name, p.age as AGE";
neo4j_map_entry_t map_entry = neo4j_map_entry("age", 28);
neo4j_value_t params = neo4j_map(&map_entry, 1);
neo4j_run(session, q, params);
当我尝试使用以下方法获取数据时:
neo4j_result_stream_t *results = neo4j_run( session, neo4j_query, params);
if (results == NULL)
{
neo4j_perror(stderr, errno, "Failed to run statement");
printf( "%s\t%s\n", move_details->move, neo4j_query);
return EXIT_FAILURE;
}
neo4j_result_t *result = neo4j_fetch_next(results);
if (result == NULL)
{
neo4j_perror(stderr, errno, "Failed to fetch result");
return EXIT_FAILURE;
}
我收到以下消息
Failed to fetch result: Success
问题是是否有任何特殊的方法来获取结果?