Book Image

Learning SQLite for iOS

By : Gene Da Rocha
Book Image

Learning SQLite for iOS

By: Gene Da Rocha

Overview of this book

The ability to use SQLite with iOS provides a great opportunity to build amazing apps. Apple's iOS SDK provides native support for SQLite databases. This combination offers the potential to create powerful, data-persistent applications. This book starts with the architecture of SQLite database and introduces you to concepts in SQL . You will find yourself equipped to design your own database system, administer it, and maintain it. Further, you will learn how to operate your SQLite databases smoothly using SQL commands. You will be able to extend the functionality of SQLite by using its vast arsenal of C API calls to build some interesting, exciting, new, and intelligent data-driven applications. Understand how Xcode, HTML5, and Phonegap can be used to build a cross-platform modern app which can benefit from all these technologies - all through creating a complete, customizable application skeleton that you can build on for your own apps.
Table of Contents (15 chapters)
Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Triggers


Triggers are an efficient way of using SQL commands to interact efficiently with the database. They are quick, and are embedded within the create trigger command.

A trigger is made up of a trigger name, references to the tables involved, an event of time (like before, or after value changes), the type of operation (like insert, update, or delete), with a variety of tables and columns to complete the operation.

The syntax has to be right and the tests should ensure that the updates and changes are correct to ensure data concurrency and stability with no corruptions.

This trigger is called update_customer_trigger, which performs an UPDATE query on the customers table. The update is going to affect the tel_no column. So, the current telephone column tel_no is going to be updated, where it will equal the value from the new table, and its column tel_no—(tel_no = new.tel_no), where the link of customer name (customer_name), equals the old.name column.

Updated triggers must use specific columns...