Migrating a SQL Anywhere application to UltraLite

Applications that you create with a SQL Anywhere connection can be modified to use an UltraLite connection. This section describes the differences between the two databases that require you to make some changes in your applications before you can use them with an UltraLite database.

Table owners

UltraLite does not support the concept of a table owner, therefore all table names must be unique in the database, and any user who successfully signs on to the UltraLite database has full access and update rights to all tables.

UltraLite does not support SQL statements that include owner-qualified table names, but the pkul920.dll and pkul1020.dll interfaces automatically process fully-qualified SQL statements at runtime to remove the table owner qualification before passing the statement to the UltraLite SQL parser. However, this does have implications for DataWindow objects that you create while connected to the UltraLite driver. The SQL SELECT statement that is generated contains unqualified SQL. This can limit the portability of a DataWindow object if you want to reuse it in an application that connects to a SQL Anywhere database using ODBC.

Views

UltraLite does not support views. You must rework existing applications that reference views so that they reference base tables instead.

Cursors

If your application uses the PowerScript DECLARE Cursor SQL statement, you might need to modify the application for connections to an UltraLite database. The pkul920.dll and pkul1020.dll interfaces use the established connection to implement the cursor, which means that you cannot nest one cursor within another, and you cannot issue other SQL statements, other than FETCH Cursor statements, while the cursor is open.

As an alternative, you can instantiate a DataStore that retrieves the same result set that the cursor returns, and rewrite your application to scroll through the DataStore instead of performing a FETCH loop through the cursor.

Stored procedures

UltraLite does not support stored procedures. You must modify your application if it uses stored procedures in any of the following ways that are supported by SQL Anywhere but not by UltraLite:

Database access limits

If two or more PocketBuilder applications are running concurrently, only one application can successfully connect to a specific UltraLite database at a time. Whichever application connects first retains exclusive use of that UltraLite database until the application closes all connections to the database.

A single PocketBuilder application can obtain two or more simultaneous connections to the same UltraLite database using different transaction objects. A single PocketBuilder application can also connect to two or more UltraLite databases concurrently by instantiating multiple transaction objects.