Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

REALSQLDatabase (SQLite)

Triggers and Views

Issue: 5.1 (September/October 2006)
Author: Paul Lefebvre
Article Description: No description available.
Article Length (in bytes): 3,440
Starting Page Number: 38
RBD Number: 5115
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

The features of SQLite that we'll be looking at this time are Triggers and Views. These are two fairly advanced database concepts, so they won't be something that you will need all the time. However, it is important to know about them and to keep them in mind as a possible way to simplify any databases you are creating.

Triggers

A database trigger is essentially code that lives on the database and that is run automatically (or is "triggered") when a specific action occurs. Triggers can be a useful way to enforce data integrity rules directly on the database. This can prevent bad data from ever being inserted into a database, even by someone who doesn't use your application.

A trigger is associated to a table and runs automatically when a specific action occurs on a table, such as inserting, updating or deleting data. The trigger contains SQL commands to run when the event occurs. Some reasons for triggers include:

You delete a row from a child table and you want to make sure that the foreign key in the parent table is set to NULL.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com