Products Support Documentation Download
Defining a Simple Schema

For our example application program, we will be needing to store one instance of a character string value. The simple schema below is declared with one table containing one column to store this value. The purpose of this schema definition is not to show the capabilities of the schema language but, rather, to show how to simply interact with the database using the C or C++ Core Cursor API. Both the following example programs will use the following schema definition for the database.

The schema below declares a table named info where our row will be stored. The info table contains rows with one column named myChar which is declared to store up to 50 characters.

1 create table info
2 (
3  myChar char(50) not null
4 );

Since we are only storing one row in this table with our application, there was no need to add an index or key to the table to allow us to find the row more quickly if more rows were to be stored in this table.

Note that the above schema uses the not null column constraint to simplify the Core API application programming. The purpose of this column constraint is to remove the automatically generated null column that is typically used for SQL applications. A typical Core Cursor application programmer seldom, if ever, needs to determine if the column in a row has been assigned a value or not. Examples of this will can be found in an advanced section describing dealing will nulls in a Core application program.

See also
Database Definition Language (DDL) User Guide