© Kevin Languedoc 2016

Kevin Languedoc, Build iOS Database Apps with Swift and SQLite, 10.1007/978-1-4842-2232-4_5

5. Inserting Records

Kevin Languedoc

(1)Montreal, Canada

The SQL Insert statement in SQLite has some interesting features, such as being able to replace an existing record, just like the Upsert statement in Oracle’s PL/SQL. The expression parameter can either be a literal or the return value from a function. We will explore these interesting features together.

This chapter will demonstrate how to insert data into a SQLite database. I will cover all the supported variations of the API, including:

  • The data-binding functions

  • Inserting records

  • Inserting or replacing records

  • The Insert or Rollback option

  • The Insert or Ignore option

  • The Insert ...

Get Build iOS Database Apps with Swift and SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.