Collection Contents Index Transact-SQL procedure language overview Returning result sets from Transact-SQL procedures pdf/chap30.pdf

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

Automatic translation of stored procedures


In addition to supporting Transact-SQL alternative syntax, Adaptive Server Anywhere provides aids for translating statements between the Watcom-SQL and Transact-SQL dialects. The following functions return information about SQL statements and enable automatic translation of SQL statements:

These are functions, and so can be accessed, for example, using a select statement from Interactive SQL. For example, the following statement:

select SqlDialect('select * from employee')

returns the value WatcomSQL.

Top of page  Using Sybase Central to translate stored procedures

Sybase Central has facilities for creating, viewing, and altering procedures and triggers.

  To translate a stored procedure using Sybase Central:
  1. Connect to a database using Sybase Central, either as owner of the procedure you wish to change, or as a DBA user.

  2. Double-click the Procedures folder for the database to list the stored procedures in the database.

  3. Using the right mouse button, click the procedure you wish to translate, and choose the dialect you wish to translate it to from the popup menu: either Watcom-SQL or Transact-SQL.

    The procedure is displayed in the selected dialect. If the selected dialect is not the one in which the procedure is stored, it is translated to that dialect by the server. Any untranslated lines are displayed as comments.

  4. Rewrite any untranslated lines as needed, and click the Execute Script button to save the translated version to the database. You can also export the text to a file for editing outside Sybase Central.

Top of page  

Collection Contents Index Transact-SQL procedure language overview Returning result sets from Transact-SQL procedures pdf/chap30.pdf