Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » UltraLite - Database Management and Reference » UltraLite Database Reference » UltraLite utilities reference


UltraLite Unload Database utility (ulunload)

Unloads any of the following, depending on the options used:

ulunload -c "connection-string" [ options ] output-file
Option Description
-b max-size Set the maximum size of column data to be stored in the XML file. The default is 10 KB. To store all data in the XML file (no maximum size), use -b -1.
-c "connection-string" Required. Connect to the database as identified in the DBF or file_name parameter of your connection-string. If you do not specify both a user ID and a password, the default UID of DBA and PWD of sql are assumed.

Only unload the data from the database to the output file. Do not unload any schema information.

-e table,...

Exclude the named table when unloading the database. You can name multiple tables in a comma-separated list. For example:

-e mydbtable1,mydbtable5
-f directory

Set the directory to store data larger than the maximum size specified by -b. The default is the same directory as the output file.

-n Unload schema only, ignoring any data in the database.
-oa Cancel the process if it identifies that the database was created by a previous version of UltraLite (which would cause the database to be upgraded).

Open the database in read-only mode. UltraLite makes a copy of the original file and uses that to unload. This ensures that databases created with earlier versions of the software are not upgraded.

If you are connecting directly from the desktop to a database already deployed to a Windows Mobile device, the parameter is not supported.

-ou Upgrade the database if it was created with an older UltraLite release.
-q Set the utility to run in quiet mode. Suppress informational banners, version numbers, and status messages. Error messages are still displayed, however.
-s Unload as SQL Anywhere-compatible SQL statements. SQL file output can be read by UltraLite or SQL Anywhere using DBISQL.
-t table,...

Unload data in the named table only. You can name multiple tables in a comma separated list. For example:

-t mydbtable2,mydbtable6
-v Print verbose messages.
-x owner Output tables so they are owned by a specific user ID. You can use this option with the -s option.
-y Overwrite output-file without confirmation.
output-file Required. Set the name of the file that the database is unloaded into. If you use the -s option, database is unloaded as SQL statements. Otherwise, the database is unloaded as XML.

By default, ulunload outputs XML that describes the schema and data in the database. You can use the output for archival purposes, or to keep the UltraLite database portable across all releases.

Saving a database with a synchronization profile results in XML that is incompatible with earlier versions of the UltraLite utilities. A workaround is to edit the XML and remove the text section marked with


Unloading a database does not preserve:

  • Synchronization state, stored synchronization counts, and row deletions. Ensure you synchronize the database before unloading it.
  • UltraLite user entries.

To confirm what database options or properties have been preserved, run ulinfo after you have reloaded your database with the ulload utility.

If column data exceeds the maximum size you specified with -b, the overflow is saved to a *.bin file in either:

The file follows this naming convention:


The -x option allows you to assign ownership to UltraLite tables. You only need to assign an owner to a table if you intend to use the resulting SQL statements for creating or modifying a SQL Anywhere database. When read by UltraLite, the owner names are silently ignored.

This utility returns error codes. Any value other than 0 means that the operation failed.

If you are using this utility to unload a database on the Windows Mobile device directly, UltraLite cannot back up the database before the unload or action occurs. You must perform this action manually before running these wizards.

See also

Unload the sample.udb database into the sample.xml file.

ulunload -c DBF=sample.udb sample.xml

Unload the data from the sample.udb database into a SQL file called sample1.sql. Overwrite the SQL file if it exists.

ulunload -c DBF=sample.udb -d -y sample.sql