Collection Contents Index Writing compatible SQL statements Automatic translation of stored procedures pdf/chap30.pdf

User's Guide
   PART 5. The Adaptive Server Family
     CHAPTER 30. Transact-SQL Compatibility       

Transact-SQL procedure language overview


The stored procedure language is that part of SQL used in stored procedures, triggers, and batches.

Adaptive Server Anywhere supports a large part of the Transact-SQL stored procedure language in addition to the Watcom-SQL dialect based on SQL/92.

Top of page  Transact-SQL stored procedure overview

The Adaptive Server Anywhere stored procedure language is based on the ISO/ANSI draft standard, which differs from the Transact-SQL dialect in many ways. Many of the concepts and features are similar, but the syntax is different. Adaptive Server Anywhere support for Transact-SQL takes advantage of the similar concepts by providing automatic translation between dialects. However, a procedure must be written in one of the two dialects exclusively, not in a mixture.

Adaptive Server Anywhere support for Transact-SQL stored procedures 

There are several aspects to Adaptive Server Anywhere support for Transact-SQL stored procedures:

Top of page  Transact-SQL trigger overview

Trigger compatibility requires compatibility of trigger features and of trigger syntax. This section provides an overview of the feature compatibility of Transact-SQL and Adaptive Server Anywhere triggers.

Adaptive Server Enterprise triggers are executed after the triggering statement has completed: they are statement level, after triggers. Adaptive Server Anywhere supports both row level triggers (which execute before or after each row has been modified) and statement level triggers (which execute after the entire statement has been executed).

Row-level triggers are not discussed here, as they are not part of the Transact-SQL compatibility features. For information on row-level triggers in Adaptive Server Anywhere, see Using Procedures, Triggers, and Batches.

Description of unsupported or different Transact-SQL triggers 

The following list describes some features of Transact-SQL triggers that are either not supported or are different in Adaptive Server Anywhere:

Top of page  Transact-SQL batch overview

In Transact-SQL, a batch is a set of SQL statements submitted together and executed as a group, one after the other. Batches can be stored in command files. The Interactive SQL utility in Adaptive Server Anywhere and the isql utility in Adaptive Server Enterprise provide similar capabilities for executing batches interactively.

The control statements used in procedures can also be used in batches. Adaptive Server Anywhere supports the use of control statements in batches and the Transact-SQL-like use of non-delimited groups of statements terminated with a GO statement to signify the end of a batch.

For batches stored in command files, Adaptive Server Anywhere supports the use of parameters in command files. Adaptive Server Enterprise does not support parameters.

For Info     For information on parameters, see PARAMETERS statement.

Top of page  

Collection Contents Index Writing compatible SQL statements Automatic translation of stored procedures pdf/chap30.pdf