[top]
[prev]
[next]

Road Map
Glossary
Table of Contents
Index
Documentation Top
Global Index
|
Examining Tables and Data in toursDB with Cloudview
Most databases are more complex than HelloWorldDB, of course. toursDB is a good example of a more complex database. In this project, you will open a connection to toursDB and then examine some of its tables and data.
Open a Connection to toursDB
- To open a connection to the toursDB database, choose Open by Name from the File menu.
- Type toursDB and click OK to connect.
The toursDB database icon now appears in the left-hand hierarchy window.
- Click the + to the left of the Table icon to display its tables.
The names of all user tables appear in the list.
Browse the Definition of the AIRLINES Table
- Select the AIRLINES table.
- Select the Table tab.
Information about the AIRLINES table definition appears in the right-hand window.
- Widen the Name and Type fields so that they display the full values.
This table stores data of four different types:
- CHAR
A fixed-length string data type. The strings in the AIRLINE column are always two characters long. When strings are always a fixed-length, it is more efficient to store them in CHAR columns. Cloudscape always allocates the right amount of space for them.
- VARCHAR
A variable-length string data type. The strings in the AIRLINE_FULL column are from 1 to 24 characters long.
- DOUBLE PRECISION
A floating-point number up to 8 bytes.
- INT
An integer.
Browse the Data in the COUNTRIES Table
- Select the COUNTRIES table icon.
- Select the Data tab.
Scroll through the data.
Quiz: Can you guess the data types in this table?
|
- Click the Table tab to get the table definition view.
COUNTRY_ISO_CODE column is of the type CHAR, with a length of 2, and the other two columns are of type VARCHAR. Those columns have a maximum length of 26 characters specified (no values are longer than 26 characters).
Disconnect, Exit (and Shut Down Cloudscape)
If you are going straight to Lesson 4, "Objects and SQL", do not do this task.
- Disconnect from the toursDB database by selecting the toursDB icon and choosing Close from the Edit menu.
- Disconnect from the HelloWorldDB database by selecting the HelloWorldDB icon and choosing Close from the Edit menu.
- Shut down Cloudview by exiting the application.
Shutting down Cloudview issues a shutdown command to Cloudscape in an embedded environment.
Quiz: What does a shutdown command do?
|
Answer: It ensures that all changes are written from the database log (a temporary holding place for transactions) to the actual database. If you do not shut down Cloudscape, the next time it connects to a database it takes the time to run recovery on the database and slows down connection time.
|
|