Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
Library | Service | Contents | Index

Using XML-SQL Utility (XSU), 9 of 26

## Inserting XML using XSU's Front End

To put an XML document in to the emp table under scott schema, use the following syntax:

    java OracleXML putXML -user "scott/tiger" -fileName "/tmp/temp.xml" "emp"

This performs the following tasks:

- Connects to the current database

- Reads the XML document from the given file

- Parses it, matches the tags with column names

- Inserts the values appropriately in to the "emp" table

  Note: The XSU's Front End putXML currently only publishes XSU's insert functionality and may be expanded in the future to also publish XSU's update and delete functionality.

#### OracleXML - putXML Options

The following lists the putXML options:

- -user "<username>/<password>"

  Used to specify the user name and password to connect to the database. If this is not specified, the user defaults to "scott/tiger". Note that he connect string is also being specified, the user name and password can be specified as part of the connect string.

- -conn "<JDBC_connect_string>"

  Used to specify the JDBC database connect string. By default the connect string is: "jdbc:oracle:oci8:@"):

- -batchSize "<batching size>"

  Used to specify the batch size, which control the number of rows which are batched together and inserted in a single trip to the database. Batching improves performance.

- -commitBatch "<commit size>"

  Used to specify the number of inserted records after which a commit is to be executed. Note that if the autocommit is true (default), then setting the commitBatch has no consequence.

- -rowTag "<tag_name>"

  Used to specify the row tag (the tag used to enclose the data coresponding to a database row). The default row tag is ROW. Specifying an empty string for the row tag tells the XSU that no row enclosing tag is used in the XML document.

- -dateFormat "<date format>"

  Used to specify the date format for the date values in the XML document.

- -ignoreCase

  Used to make the matching of the column names with tag names case insensitive (e.g. "EmpNo" will match with "EMPNO" if ignoreCase is on).

- -fileName "<file name>" | -URL "<url>" | -xmlDoc "<xml document>"

  Used to specify the XML document to insert. The fileName option specifies a local file, the URL specifies a URL to fetch the document from and the xmlDoc option inlines the XML document as a string on the command line.

- <tableName>

  The name of the table to put the values into.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index