Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning SQLite for iOS

You're reading from   Learning SQLite for iOS Extend SQLite with mobile development skills to build great apps for iOS devices

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781785288975
Length 154 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Gene Da Rocha Gene Da Rocha
Author Profile Icon Gene Da Rocha
Gene Da Rocha
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Introduction to SQL and SQLite FREE CHAPTER 2. Database Design Concepts 3. Administering the Database 4. Essentials of SQL 5. Exposing the C API 6. Using Swift with iOS and SQLite 7. iOS Development with PhoneGap and HTML5 8. More Features and Advances in SQLite 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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime