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

test[FMDB] 005 Insert some records

| db databasePath |
databasePath := 'Sample.sqlite' asLocalPathName.

db := FMDatabase withPath: databasePath.
db open ifTrue: [
	db executeUpdate: 'insert into Books (Title, Author, Pages) values (?,?,?)' withArgumentsInArray: #('Smalltalk-80: The Language and its Implementation'  'Adele Goldberg' 714).
	db executeUpdate: 'insert into Books (Title, Author, Pages) values (?,?,?)' withArgumentsInArray: #('Smalltalk, Objects, and Design'  'Chamond Liu' 289).
	db executeUpdate: 'insert into Books (Title, Author, Pages) values (?,?,?)' withArgumentsInArray: #('Smalltalk With Style'  'Edward Klimas' 127).
	db executeUpdate: 'insert into Books (Title, Author, Pages) values (?,?,?)' withArgumentsInArray: #('Smalltalk Best Practice Patterns 1st Edition'  'Kent Beck' 240).
	db close. 
].