Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

Tutorial 3: Locking

<faircomInstallFolder>\drivers\c.sql.direct\tutorials\DSQL_tutorial3.c

This tutorial performs the following:

  1. Logon onto a session
  2. Add 1 table with some fields
  3. Populate the table with a few records
  4. Display the contents of the table
  5. Update one record under locking control

To keep this program as simple as possible, we use four standard procedures:

  • Initialize() - Connects to the FairCom Database Engine.
  • Define() - Defines and creates a "customer master" (custmast) table/file.
  • Manage() - Adds a few rows/records; Reads the rows/records back from the database; displays the column/field content; and then deletes the rows/records.
  • Done() - Disconnects from FairCom Database Engine.

Note our simple Main() function:

/*

* main()

*

* The main() function implements the concept of "init, define, manage

* and you're done..."

*/

int main(int argc, char* argv[])

{

Initialize();

Define();

Manage();

Done();

printf("\nPress <ENTER> key to exit . . .\n");

getchar();

return(0);

}

We suggest opening the source code with your own editor.

Continue now to review these four steps.

In This Section

Init

Define

Manage

Done

TOCIndex