Oracle updating recordset during cursor
A quick word on PRIMARY KEYS: In our example code above, we set our 1 column in the second table to PRIMARY KEY.
The advantage of a PRIMARY KEY index is a significant performance gain if we use the PRIMARY KEY column as query for accessing rows in the table. 1 PRIMARY KEY (single or multiple column(s)), and the values in this column MUST be unique!
But more on column indexing in the a later section.
If we want to add a new column to an existing SQLite database table, we can either leave the cells for each row empty (NULL value), or we can set a default value for each cell, which is pretty convenient for certain applications.
Tip: A handy tool to visualize and access SQLite databases is the free Fire Fox SQLite Manager add-on.
Throughout this article, I will use this tool to provide screenshots of the database structures that we created below the corresponding code sections.
Looking at the table above, You might have noticed that SQLite 3 has no designated Boolean data type.
However, this should not be an issue, since we could simply re-purpose the INTEGER type to represent Boolean values (0 = false, 1 = true).
To round up this section about connecting to a SQLite database file, there are two more operations that are worth mentioning.
If we are finished with our operations on the database file, we have to close the connection via the Let us have a look at some example code to create a new SQLite database file with two tables: One with and one without a PRIMARY KEY column (don’t worry, there is more information about PRIMARY KEYs further down in this section).