Developers who learn Sybase after learning another DBMS system should not confuse Sybase’s dynamic SQL implementation with that of other vendors. With Adaptive Server Enterprise, most command types are “dynamic.” The closest analogy that Adaptive Server Enterprise offers to “static SQL commands” are stored procedures. However, any client application can invoke a stored procedure, as long as the procedure’s permissions allow the client program’s user to execute it. Other DBMS systems may limit the scope of a precompiled static SQL command to the precompiled application.
For Adaptive Server Enterprise applications, many tasks that require you to use dynamic SQL with another DBMS can be implemented with Client-Library command types other than dynamic SQL. For example:
For an application that must execute SQL statements whose text is not known prior to runtime, you can code the client program to define language commands by calling ct_command. This method is appropriate for commands that are only executed once or a small number of times.
For an application that must execute commands whose text is known before runtime and where performance is important, you can create an Adaptive Server Enterprise stored procedure and code the client program to invoke the procedure with RPC commands (defined with ct_command).
For an application that must interactively define and open cursors, you can code the client program to define the cursor-declare commands with ct_cursor.