Wednesday 15 May 2013


SOQL Basics

Despite being one letter away from SQL and borrowing some of its syntax, SOQL is
completely different and much easier to understand on its own terms. Just as Apex is not a
general-purpose programming language like Java, SOQL is not a general-purpose database
query language like SQL. SOQL is specifically designed and optimized for the Force.com
database.
A SOQL statement is centered on a single database object, specifying one or more
fields to retrieve from it.The fields to select are separated by commas. Listing 5-25 is a
simple SOQL statement that returns a list of Account records with Id and Name fields
populated. SOQL is not case-sensitive. SOQL keywords are shown throughout the book
in uppercase and metadata objects in title case for readability only.

Listing 5-25 
SELECT Id, Name
FROM Account

No comments:

Post a Comment