diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-B38EBDBA-2A30-5595-9639-6AE58C530DCB.dita --- a/Symbian3/PDK/Source/GUID-B38EBDBA-2A30-5595-9639-6AE58C530DCB.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-B38EBDBA-2A30-5595-9639-6AE58C530DCB.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,83 +1,83 @@ - - - - - -Creating -a Database This document shows you how to create a database for Symbian SQL. - - -

Working with databases -is not possible until the database exists. In this tutorial you will learn -how to create a simple database.

This tutorial uses code from the Basic SQL example application.

The -SQL statement used for this tutorial is shown here:

CREATE DATABASE \\Basic_db.db
- -Declare a constant -to hold the database handle: - - KDatabaseName will be used when creating and accessing -the database. -_LIT(KDatabaseName, "\\Basic_db.db"); -_LIT(KDatabaseMsg,"\nCreating a database\n"); -RSqlDatabase db; -CConsoleBase* iConsole; -The objects and constants needed to create the database are now -ready. - -Create the database: - -You are telling Symbian SQL to execute the CREATE DATABASE command. -iConsole->Printf(KDatabaseMsg); -User::LeaveIfError(db.Create(KDatabaseName)); -iConsole->Printf(KDatabaseName); -The database now exists. RSqlDatabase::Create() executes -the SQL engine command that makes the actual database. You can look in the C:\ drive -on the device to confirm that the database object exists. - - -

The database now -exists. You can perform all the standard SQL operations on the database including -creating and populating a table, querying the database, editing records and -deleting the database, to name a few.

-Create database -example

The following code snippet is from the example code used -for this tutorial:

... -_LIT(KDatabaseName, "\\Basic_db.db"); -_LIT(KDatabaseMsg,"\nCreating a database\n"); -... -CConsoleBase* iConsole; -... -void CBasicSqlExample::CreateDatabaseL() - { - RSqlDatabase db; - - iConsole->Printf(KDatabaseMsg); - //create the database - User::LeaveIfError(db.Create(KDatabaseName)); - - iConsole->Printf(KDatabaseName); - CleanupClosePushL(db); - ... - }
-

Now that you have -created a database you need to add a table and populate it with some data. -The following will show you how:

    -
  • Creating -a Table

  • -
  • Inserting -Data into a Table

  • -
  • Writing -from a Data Stream

  • -
-
-SQL Overview - -Basic SQL -Example Application + + + + + +Creating +a Database This document shows you how to create a database for Symbian SQL. + + +

Working with databases +is not possible until the database exists. In this tutorial you will learn +how to create a simple database.

This tutorial uses code from the Basic SQL example application.

The +SQL statement used for this tutorial is shown here:

CREATE DATABASE \\Basic_db.db
+ +Declare a constant +to hold the database handle: + + KDatabaseName will be used when creating and accessing +the database. +_LIT(KDatabaseName, "\\Basic_db.db"); +_LIT(KDatabaseMsg,"\nCreating a database\n"); +RSqlDatabase db; +CConsoleBase* iConsole; +The objects and constants needed to create the database are now +ready. + +Create the database: + +You are telling Symbian SQL to execute the CREATE DATABASE command. +iConsole->Printf(KDatabaseMsg); +User::LeaveIfError(db.Create(KDatabaseName)); +iConsole->Printf(KDatabaseName); +The database now exists. RSqlDatabase::Create() executes +the SQL engine command that makes the actual database. You can look in the C:\ drive +on the device to confirm that the database object exists. + + +

The database now +exists. You can perform all the standard SQL operations on the database including +creating and populating a table, querying the database, editing records and +deleting the database, to name a few.

+Create database +example

The following code snippet is from the example code used +for this tutorial:

... +_LIT(KDatabaseName, "\\Basic_db.db"); +_LIT(KDatabaseMsg,"\nCreating a database\n"); +... +CConsoleBase* iConsole; +... +void CBasicSqlExample::CreateDatabaseL() + { + RSqlDatabase db; + + iConsole->Printf(KDatabaseMsg); + //create the database + User::LeaveIfError(db.Create(KDatabaseName)); + + iConsole->Printf(KDatabaseName); + CleanupClosePushL(db); + ... + }
+

Now that you have +created a database you need to add a table and populate it with some data. +The following will show you how:

    +
  • Creating +a Table

  • +
  • Inserting +Data into a Table

  • +
  • Writing +from a Data Stream

  • +
+
+SQL Overview + +Basic SQL +Example Application
\ No newline at end of file