Commands and Functions
Commands and Functions
Types of SQL statements
Functions
16
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.
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
.
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
•
Program control statements control the flow of program execution. They
do not operate directly on your IQ tables. Examples include
.
ROLLBACK
Functions return information from the database. They are allowed anywhere an
expression is allowed. Adaptive Server IQ provides functions that:
•
Aggregate data (for example,
•
Manipulate numeric data (for example,
)
TRUNCATE
•
Manipulate string data (for example,
,
CREATE INDEX
, and
.
INSERT
,
,
AVG
COUNT
MAX
,
ABS
CEILING
,
LENGTH
,
, and
ALTER TABLE
,
, and
IF
CALL
,
,
)
MIN
SUM
,
,
SQRT
,
)
SOUNDEX
UCASE