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

test[sqlite3] 005 Insert some records

[ | db values |
db := SQLiteDatabase openDatabase: '/data/data/net.smalltalking.s8.jx8/testdb' factory: nil flags: SQLiteDatabase openReadwrite.
values := ContentValues instance.
values put: 'code' value: 'Smalltalk'.
values put: 'description' value: 'great'.
db insert: 'testTable' nullColumnHack: nil values: values.
values := ContentValues instance.
values put: 'code' value: 's8'.
values put: 'description' value: 'fantastic'.
db insert: 'testTable' nullColumnHack: nil values: values.
values := ContentValues instance.
values put: 'code' value: 's8'.
values put: 'description' value: 'invisible machine'.
db insert: 'testTable' nullColumnHack: nil values: values.
db close.
] on: Error do: [:ex | self print: 'records could not be inserted' ]