We will delete a database table row using the XML SQL Utility. A database table row can be deleted by specifying element tags corresponding to key columns in an XML document. An example XML document, catalog-delete.xml
, specifies the catalogId
, "catalog2". We will delete from the table JOURNAL
the row for which the primary key column, CATALOGID
, that has the value "catalog2" as specified in catalog-delete.xml
is listed below:
<?xml version="1.0" encoding="utf-8"?> <catalog> <journal> <catalogId>catalog2</catalogId> </journal> </catalog>
We have to create an OracleXMLSave
object, setting the row enclosing tag and setting ignore case to true
, as discussed in the previous section.
OracleXMLSave oracleXMLSave =new OracleXMLSave(conn, "JOURNAL"); oracleXMLSave.setRowTag("journal"); oracleXMLSave.setIgnoreCase(true);
Set key columns using the setKeyColumnList(String[] keyColumns)
method and set CATALOGID
as a key column.
String...