#include <stdio.h>
#include <string.h>
#include "example_fcns.h"
#include "core09_structs.h"
#include "core09_cat.h"
const char *const description = "Demonstrates database union read";
{
OFFICE office_rec;
print_error (rc);
{
print_error (rc);
{
cursor, &office_rec, sizeof (office_rec), NULL);
print_error (rc);
printf ("%s\n", office_rec.name);
}
if (cursor)
{
}
}
return rc;
}
{
OFFICE office_rec;
print_error (rc);
{
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);
}
else
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"};
{
rc = exampleOpenNextEmptyDatabase (hTFS, &hDB, "core09NA", core09_cat);
{
rc = insertOffices (hDB, na_office_names, RLEN (na_office_names));
}
rc = exampleOpenNextEmptyDatabase (hTFS, &hDB, "core09EMEA", core09_cat);
{
rc = insertOffices (hDB, emea_office_names, RLEN (emea_office_names));
}
return rc;
}
int main_core09 (int argc, const char *const *argv)
{
print_error (rc);
{
rc = exampleAllocTFS (&hTFS);
{
rc = loadDatabase (hTFS);
}
{
print_error (rc);
}
{
print_error (rc);
{
printf ("\nAll Worldwide Offices\n");
display_offices (hDB);
}
}
}
return (int) rc;
}