#include <stdio.h>
#include <string.h>
#include "example_fcns.h"
#include "core12_structs.h"
#include "core12_cat.h"
const char *const description = "Demonstrates transaction commit/rollback";
{
print_error (rc);
{
print_error (rc);
{
print_error (rc);
{
print_error (rc);
{
print_error (rc);
}
{
print_error (rc);
}
{
print_error (rc);
}
{
}
}
}
{
}
}
return rc;
}
void cleanup (
{
}
{
OFFICE office_rec;
print_error (rc);
{
print_error (rc);
printf ("%s\n", office_rec.name);
}
if (cursor)
{
}
return rc;
}
{
OFFICE office_rec;
for (int ii = 0; ii < (int) listSize; ii++)
{
strncpy (office_rec.name, officeList[ii], sizeof (office_rec.name));
hDB, TABLE_OFFICE, &office_rec, sizeof (office_rec), NULL);
print_error (rc);
}
return rc;
}
static const char *na_office_names[] = {"Seattle", "Boise", "San Francisco",
"Dallas"};
static const char *emea_office_names[] = {"Paris", "London", "Dublin", "Zurich",
"Madrid"};
#define RLEN(x) (sizeof (x) / sizeof (x[0]))
int main_core12 (int argc, const char *const *argv)
{
print_error (rc);
{
rc = openEmptyDatabase (&hTFS, &hDB);
{
print_error (rc);
{
insertOffices (hDB, na_office_names, RLEN (na_office_names));
printf ("\nAll Offices before transaction commit.\n");
display_offices (hDB);
print_error (rc);
{
printf ("\nAll Offices after transaction commit.\n");
display_offices (hDB);
}
}
{
print_error (rc);
{
insertOffices (
hDB, emea_office_names, RLEN (emea_office_names));
printf ("\nAll Offices before transaction commit.\n");
display_offices (hDB);
print_error (rc);
printf ("\nAll Offices after transaction rollback.\n");
display_offices (hDB);
}
}
}
cleanup (hTFS, hDB);
}
return (int) rc;
}