[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[sqlite3] 003 Create a test table

[ | createTable db |
db := SQLiteDatabase openDatabase: '/data/data/net.smalltalking.s8.jx8/testdb' factory: nil flags: SQLiteDatabase openReadwrite.
createTable := 'CREATE TABLE testTable (',
'id INTEGER PRIMARY KEY AUTOINCREMENT, ',
'code TEXT, ',
'description TEXT',
')'.
db execSQL: 'DROP TABLE IF EXISTS ', 'testTable'.
db execSQL: createTable.
db close.
] on: Error do: [:ex | self print: 'table could not be created' ]