This tutorial shows you how to create a Symbian SQL table.
This tutorial uses code from the Basic SQL example application.
Assumptions
You have a database. The database has no tables and therefore no data.
SQL statements
The following SQL statements are used for this example:
CREATE TABLE Pets( person TEXT, cat SMALLINT, dog SMALLINT, rodent SMALLINT, bird SMALLINT)
The RSqlDatabase::Exec function provides a mechanism for executing Symbian SQL statements.
Your database now has at least one table. You can begin to add data to the table and you can query and edit it.
The following code snippet is from the example used for this tutorial:
_LIT(KTabCreate,"CREATE TABLE Pets( person TEXT, cat SMALLINT, dog SMALLINT, rodent SMALLINT, bird SMALLINT);"); _LIT(KCreateTable,"\nCreating a table\n"); ... CConsoleBase* iConsole; ... RSqlDatabase db; iConsole->Printf(KCreateTable); ... User::LeaveIfError(db.Exec(KTabCreate)); ...