Commands and Functions
16
Commands and Functions
All Adaptive Server IQ commands are SQL statements. SQL stands for
Structured Query Language, a language commonly used in database
applications. Adaptive Server IQ SQL uses the same syntax as Adaptive Server
Anywhere SQL; the only differences are for certain product capabilities that
are supported only for IQ or for Anywhere. Adaptive Server IQ SQL also offers
a high degree of compatibility with Transact-SQL, the SQL dialect used by
Adaptive Server Enterprise.
This section introduces the types of commands and functions you can use.
Other chapters of this book tell you about the commands you use to perform
various administrative tasks. For complete details of supported commands and
functions, see the Adaptive Server IQ Reference Manual.
Types of SQL statements
You use three basic types of SQL statements:
• DDL (Data Definition Language) statements let you define and modify
your database schema and table and index definitions. Examples of DDL
statements include
CREATE TABLE, CREATE INDEX, ALTER TABLE, and
DROP.
• DML (Data Manipulation Language) statements let you query your data,
and move data into and out of the database. Examples of DML statements
include
SELECT, SET, and INSERT.
• Program control statements control the flow of program execution. They
do not operate directly on your IQ tables. Examples include
IF, CALL, and
ROLLBACK.
Functions
Functions return information from the database. They are allowed anywhere an
expression is allowed. Adaptive Server IQ provides functions that:
• Aggregate data (for example,
AVG, COUNT, MAX, MIN, SUM)
• Manipulate numeric data (for example,
ABS, CEILING, SQRT,
TRUNCATE)
• Manipulate string data (for example,
LENGTH, SOUNDEX, UCASE)