Create, insert and access a simple table.
#include <test_util.h>
static const char *home;
static void
access_example(void)
{
const char *key, *value;
int ret;
error_check(conn->
open_session(conn, NULL, NULL, &session));
session, "table:access", "key_format=S,value_format=S"));
session, "table:access", NULL, NULL, &cursor));
error_check(cursor->
insert(cursor));
error_check(cursor->
reset(cursor));
while ((ret = cursor->
next(cursor)) == 0) {
error_check(cursor->
get_key(cursor, &key));
error_check(cursor->
get_value(cursor, &value));
printf("Got record: %s : %s\n", key, value);
}
error_check(conn->
close(conn, NULL));
}
int
main(int argc, char *argv[])
{
home = example_setup(argc, argv);
access_example();
return (EXIT_SUCCESS);
}