Share My Creation How to ALTER TABLE with SQLite

How To ALTER TABLE with SQLite
1. Starting this program will creat a SQLite Database

2. A Table named 'Meetings' is created using the DBUtils Module
I have modified the DBUtils module To suit my own need
AUTOINCREMENT keyword was added To CreateTable

From SQLite Info...
CREATE TABLE maxed_out(id INTEGER PRIMARY KEY AUTOINCREMENT, x text);

If you include the keyword AUTOINCREMENT after INTEGER PRIMARY KEY, SQLite will use a
different key generation algorithm For the column. This algorithm basically prevents ROWIDs
from being recycled. It guarantees that only new (Not recycled) ROWIDs are provided For every
INSERT. When a table Is created with a column containing the AUTOINCREMENT constraint, SQLite
will keep track of that column’s maximum ROWID In a system table called sqlite_sequence. It
will only use values greater than that maximum on all subsequent INSERTs. If you ever reach the
absolute maximum, Then SQLite will Return a SQLITE_FULL error on subsequent INSERTs.

3. Click Add To Table Button AND data Is Inserted into the 'Meetings' Table.
4. Click Show Table Button AND the 'Meetings' Table is displayed in a TableView
Five Columns In the 'Meetings' Table are then displayed in the TableView
5. Click Alter Table Button AND the table will Then be changed To have an additional Column 'DLS' with INTEGER Type data
6. Click Show Table Button AND now the TableView will be displayed with the additional Column 'DLS'
 

Attachments

  • AlterTable.zip
    4.8 KB · Views: 395
Top