Chapter 12 Differences from Other SQL Dialects
955
Adaptive Server Anywhere allows automatic joins between tables. In
addition to the NATURAL and OUTER join operators supported in other
implementations, Adaptive Server Anywhere allows KEY joins between
tables based on foreign key relationships. This reduces the complexity of the
WHERE clause when performing joins.
Adaptive Server Anywhere allows more than one table to be referenced by
the UPDATE command. Views defined on more than one table can also be
updated. Many SQL implementations will not allow updates on joined tables.
The ALTER TABLE command has been extended. In addition to changes
for entity and referential integrity, the following types of alterations are
allowed:
ADD column data-type
MODIFY column data-type
DELETE column
RENAME new-table-name
RENAME old-column TO new-column
The MODIFY can be used to change the maximum length of a character
column as well as converting from one data type to another. For more
information, see "ALTER TABLE statement" on page 392.
Adaptive Server Anywhere allows subqueries to appear wherever
expressions are allowed. Many SQL implementations only allow subqueries
on the right side of a comparison operator. For example, the following
command is valid in Adaptive Server Anywhere but not valid in most other
SQL implementations.
SELECT emp_lname,
emp_birthdate,
( SELECT skill
FROM department
WHERE emp_id = employee.emp_ID
AND dept_id = 200 )
FROM employee
Adaptive Server Anywhere supports several functions not in the ANSI SQL
definition. See "SQL Functions" on page 303 for a full list of available
functions.
When using Embedded SQL, cursor positions can be moved arbitrarily on
the FETCH statement. Cursors can be moved forward or backward relative
to the current position or a given number of records from the beginning or
end of the cursor.
Joins
Updates
Altering tables
Subqueries where
expressions are
allowed
Additional
functions
Cursors