Contents Index Keywords Identifiers

ASA SQL Reference
  SQL Language Elements
    Keywords

Reserved words


Some keywords in SQL are also reserved words. To use a reserved word in a SQL statement as an identifier, you must enclose it in double quotes. Many, but not all, of the keywords that appear in SQL statements are reserved words. For example, you must use the following syntax to retrieve the contents of a table named SELECT.

SELECT *
FROM "SELECT"

Because SQL is not case sensitive with respect to keywords, each of the following words may appear in upper case, lower case, or any combination of the two. All strings that differ only in capitalization from one of the following words are reserved words.

If you are using Embedded SQL, you can use the database library function SQL_needs_quotes to determine whether a string requires quotation marks. A string requires quotes if it is a reserved word or if it contains a character not ordinarily allowed in an identifier.

The SQL keywords in Adaptive Server Anywhere are as follows:

Reserved word Reserved word Reserved word Reserved word
add all alter and
any as asc backup
begin between bigint binary
bit bottom break by
call capability cascade case
cast char char_convert character
check checkpoint close comment
commit connect constraint contains
continue convert create cross
cube current cursor date
dbspace deallocate dec decimal
declare default delete deleting
desc distinct do double
drop dynamic else elseif
encrypted end endif escape
except exception exec execute
existing exists externlogin fetch
first float for foreign
forward from full goto
grant group having holdlock
identified if in index
inner inout insensitive insert
inserting install instead int
integer integrated intersect into
iq is isolation join
key lateral left like
lock login long match
membership message mode modify
natural new no noholdlock
not notify null numeric
of off on open
option options or order
others out outer over
passthrough precision prepare primary
print privileges proc procedure
publication raiserror readtext real
reference references release remote
remove rename reorganize resource
restore restrict return revoke
right rollback rollup save
savepoint scroll select sensitive
session set setuser share
smallint some sqlcode sqlstate
start stop subtrans subtransaction
synchronize syntax_error table temporary
then time timestamp tinyint
to top tran trigger
truncate tsequal unbounded union
unique unknown unsigned update
updating user using validate
values varbinary varchar variable
varying view wait waitfor
when where while window
with with_lparen within work
writetext

Contents Index Keywords Identifiers