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 Initialize Database utility (ulinit) Next Page

UltraLite Load XML to Database utility (ulload)


This utility performs the following functions:

Syntax

ulload -c "connection-string" [ options ] xml-file

OptionDescription
-a

Append data and schema definitions into an existing database.

If you are appending data into a pre-existing record-based database for Palm OS (that is, one with a .pdb extension), do not use the -p option.

-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.

-d

Load data only, ignoring any schema data in the XML file input.

-f directory

Set the XML file directory to an external path.

-g ID

Set the initial database ID to the INTEGER value you assign. This value is used by the database for all new rows that have global autoincrement columns. The database uses this base value to autoincrement IDs associated with each additional row and/or column.

When deploying an application, you must assign a different identification number to each database for synchronization with the MobiLink server.

-i

Include inserted rows in the next upload synchronization. By default, rows inserted by this utility are not uploaded during synchronization.

-n

Load schema data only, ignoring any data in the XML file input.

-o [ extended-options ]

Set the UltraLite extended database creation options. See Extended creation-time options.

-ol

List the available extended database creation options and exit. See Extended creation-time options.

-onerror behavior

Control what happens if an error is encountered while reading data from the XML file. Define one of the following supported behavior values:

  • continue  The error is ignored and ulload continues to load XML.

  • prompt  ulload prompts you to see if you want to continue.

  • quit  ulload stops loading the XML and terminates with an error. This is the default behavior if none is specified.

  • exit  ulload exits.

-or

Open database in read-only mode. UltraLite makes a copy of the original file, and then use the copy 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, this option is not supported.

-p creator-ID

Required for Palm OS only when you are creating a new database from the loaded file. Create the database with the specified four character creator-ID of the UltraLite client application.

If you are appending data into a pre-existing record-based database for Palm OS (that is, one with a .pdb extension), do not use this option with the -a option.

-q

Run in quiet mode—do not print messages.

-s file

Log the SQL statements used to load the database into the specified file.

-t file

Specify the file containing the trusted root certificate. This certificate is required for server authentication.

-v

Print verbose messages.

-y

Overwrite xml-file without confirmation.

xml-file

Specify the name of the XML file from which data is loaded.

Remarks

The ulload utility creates the UltraLite database file, if the named file does not already exist.

Setting an option or specifying a certificate on the command line overrides any settings in the xml-file that is processed by ulload.

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

Palm OS databases    Palm databases written to the desktop can be identified with the .pdb extension. See Palm OS.

However, once you deploy this file to the device, the extension is dropped.

See also
Example

Create a new UltraLite database file, sample.udb, and load it with data in sample.xml:

ulload -c DBF=sample.udb sample.xml

Load the data from sample.xml into the existing database sample.udb, and if an error occurs, prompt for action:

ulload -d -c DBF=sample.udb -onerror prompt sample.xml

Load XML from a file named test_data.xml into the copy UltraLite makes of the database named sample.udb. Discard those changes upon completion. This allows you to check for errors in the XML data and correct them. When data loads successfully, you can run the command without the -or option to keep the XML updates.

ulload -or -c DBF=sample.udb -a test_data.xml