Adding OBJECT
data to an Oracle database
Use the input schema to add OBJECT
data to your Oracle
database.
Before you begin
For this example to work, a database administrator must run the following SQL statements to create an example object. You can have your database administrator run the SQL statements, or you can modify the example to use an existing object.
CREATE OR REPLACE TYPE ADDRESS_OBJECT_TYPE AS OBJECT (
streetAddress VARCHAR(30),
city VARCHAR(30),
state VARCHAR(2),
postalCode INTEGER);
/
grant all privileges on ADDRESS_OBJECT_TYPE TO DBUSER;
CREATE TABLE DBUSER.CUSTOMER_TABLE (
lname VARCHAR(30),
address ADDRESS_OBJECT_TYPE);
Additionally, you need an input XML file in this
format.
<?xml version="1.0" encoding="UTF-8"?>
<Customer>
<lastname>Smith</lastname>
<address>10 Main Street</address>
<city>Boston</city>
<state>MA</state>
<zip>02188</zip>
</Customer>
About this task
The SQL INSERT
statement adds OBJECT
data to the database.
Procedure
Results
<?xml version="1.0" encoding="UTF-8"?>
<sql result="success" modified="1"/>