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

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite Utilities Reference

UltraLite Synchronization utility (ulsync) Next Page

UltraLite Unload Database to XML utility (ulunload)

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


ulunload -c "connection-string" [ options ] output-file

-b max-size

Set the maximum size of column data to be stored in the XML file. The default is 10 K. To store all data in the XML file (that is, to have 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.


Unload data only, ignoring any schema information in the database.

Do not use this option if you intend to reload the XML file into a new database using the ulload utility.

-e table,...

Exclude data in the named table. 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 XML file.


Unload schema only, ignoring any data in the database.


Open the database in read-only mode. UltraLite makes a copy of the original file, which you can then use to test your scripts without altering the database. Changes to the copied file are discarded upon completion.

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


Run in quiet mode. Do not print messages.


Unload schema only as SQL Anywhere-compatible SQL statements; ignore any data in the database.

-t table,...

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

-t mydbtable2,mydbtable6

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.


Overwrite output-file without confirmation.


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.

Preservation    Unloading a database does not preserve:

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

Column data overflows    If column data exceeds the maximum size you specified with -b, the overflow is saved to a *.bin file in either the same directory as the XML file, or in the directory specified by -f. The file follows this naming convention:


Assigning table ownership    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. Do not use this option if you are using the resulting SQL to create or modify an UltraLite database.

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

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 the sample.xml file. Overwrite the database if it exists.

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