Article Preview
Buy Now
FEATURE
A Predicate For Data, Part 1
Building and implementing a basic predicate model
Issue: 16.2 (March/April 2018)
Author: JC Cruz
Author Bio: JC is a freelance writer based in British Columbia. He is a regular contributor to MacTech Magazine and Dr Dobb's Journal. Away from the writing pile, JC spends quality time with his nephew, as a proper uncle should.
Article Description: No description available.
Article Length (in bytes): 37,870
Starting Page Number: 66
Article Number: 16206
Resource File(s):
project 16206.zip Updated: 2018-02-28 18:43:13
Related Link(s): None
Excerpt of article text...
Predicates play an important part in data queries and transactions. They limit the query results to a specific set, and they set the conditions for changes.
In today's article, I demonstrate how I implement a predicate model. I begin with an overview of predicates in SQL, explaining their syntax and their effects on various operations. I shall design a model class, define the methods for constructing and managing a predicate. And I shall use the predicate model from within a data model and a controller module.
Readers need a working knowledge of REALbasic, SQLite and object-oriented design. The updated version of the demo project FooHealth (Mk12) is available from the magazine's website.
Predicates in SQL
A typical SQL statement has one or more clauses. First is the command clause, which declares the action and the data table to be acted upon. Next is the schema clause, which defines the data fields affected by the action. Last is the predicate clause, which sets the action's scope and behaviour.
...End of Excerpt. Please purchase the magazine to read the full article.