Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Influence xmltype creation when register XML Schema

656158Aug 21 2008 — edited Sep 17 2008

Hi,

I'm trying to register an XML Schema a little differently from the default Oracle 11 way.

Let say, I've got an element definition in my XML Schema:

<xs:element name="foobar">
  <xs:complexType>
    <xs:all>
      <xs:element name="var_number_one" type="myVar" />
      <xs:element name="var_number_two" type="myVar" minOccurs="0" />
      <xs:element name="var_number_three" type="myVar" />
    ...
      <xs:element name="var_number_onehundredfiftyone" type="myVar" minOccurs="0" />
      <xs:element name="var_number_onehundredfiftytwo" type="myVar" />
    </xs:all>
  </xs:complexType>
</xs:element>

This gets processed by Oracle during the registration process, I use these parameters for registerSchema:

LOCAL      => TRUE,     -- local
GENTYPES   => TRUE,     -- generate object types
GENBEAN    => FALSE,    -- no java beans
GENTABLES  => TRUE,     -- generate object tables
FORCE      => FALSE,
OPTIONS    => DBMS_XMLSCHEMA.REGISTER_AUTO_OOL

The result is that each element gets the following attributes:

oraxdb:propNumber="4986"
oraxdb:global="false"
oraxdb:SQLName="var_number_one"
SQLType="var_number_one928_T"
oraxdb:SQLSchema="SYSTEM"
oraxdb:memType="258"
oraxdb:MemInline="false"
oraxdb:SQLInline="true"
oraxdb:JavaInline="false"

which means that each element (var_number_*) is like an SQL Object column/property in the foobar table/object... right?

Here is what I would like to try, if it is possible at all:

I want the name of the element to be a varchar property/column of each row in the foobar table.

The image attached http://www.flickr.com/photos/23407846@N08/2784396692/sizes/o/ illustrates the current and target situation.

Is it possible to do this by influencing the XML Schema without changing the original xml format, using the oraxdb attributes? Or is their another solution?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2008
Added on Aug 21 2008
6 comments
821 views