There are two criteria for writing a query that runs on both SQL Anywhere and Adaptive Server Enterprise databases:
This section explains compatible SELECT statement syntax, and assumes compatible data types, expressions, and search conditions. The examples assume the quoted_identifier setting is Off: the default Adaptive Server Enterprise setting, but not the default SQL Anywhere setting.
SQL Anywhere supports the following subset of the Transact-SQL SELECT statement:
SELECT [ ALL | DISTINCT ] select-list ...[ INTO #temporary-table-name ] ...[ FROM table-spec [ HOLDLOCK | NOHOLDLOCK ], ... table-spec [ HOLDLOCK | NOHOLDLOCK ], ... ] ...[ WHERE search-condition ] ...[ GROUP BY column-name, ... ] ...[ HAVING search-condition ] [ ORDER BY { expression | integer } [ ASC | DESC ], ... ]
select-list:
table-name.*
| *
| expression
| alias-name = expression
| expression as identifier
| expression as string
table-spec: [ owner . ]table-name ...[ [ AS ] correlation-name ] ...[ ( INDEX index_name [ PREFETCH size ][ LRU | MRU ] ) ]
alias-name: identifier | 'string' | "string"
SQL Anywhere does not support the following keywords and clauses of the Transact-SQL SELECT statement syntax:
SELECT @localvar = 42; |
The corresponding statement in SQL Anywhere is the SET statement:
SET @localvar = 42; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |