Generating table with XML Type column while registering schema

Hi,
Is it possible to generate a table with an XML Type column during schema registering. Does the "xdb:defaultTable" always create an XMLType table?
Thanks.
Rahul

"You can create XML schema-based XMLType tables and columns and optionally specify, for example, that they:Conform to pre-registered XML schema ."
http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb01int.htm

Similar Messages

  • XML SQL - query the table with XML in column [urgent]

    I have table which have to be query-ied with
    oracle.xml.sql.query.OracleXMLQuery class to produce XML
    document for web.
    Problem is that in one column is already XML data (well formed
    HTML) like this:
    <font face="Arial">click</font>
    and when I call OracleXMLQuery.getXMLString() it encode all's '<'
    as ';lt' and so on.
    Can I turn off that kind of encoding some way or is it better
    sollution for this?
    thanks in advance
    Bojan
    null

    You can use an XSLT Stylesheet to achieve what you are wanting to do.
    Say the name of the column containing
    the markup is named "DOC", then
    transforming the output of OracleXMLQuery
    by the following stylesheet using
    the oracle.xml.parser.v2.XSLProcessor...
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl utput method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="DOC">
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:template>
    </xsl:stylesheet>
    Will give the results you are looking for.
    You can use the XSQL Servlet to make this combination even easier if that is applicable to your situation.

  • Xml type column

    Hi,
    This is my first time ever working with xml type column. I have a xml type column with name,value pairs. This xml type column needs to be indexed. How can I index this column(which index is suitable)? Also can xml type column be used in where clause for the joins with another table columns.
    Thank You
    SK

    XMLTypes in 10.1 are extremely slow and extremely buggy.
    They're maginally better in 10.2 (with the exception of anything added in that release, most notably XQuery), although there are some disasterous bugs in 10.2 in functionality that was actually fine in 10.1 (e.g. memory leaks, scaling nightmares).
    The XML Respository (required for XSD registration and shredding) is very unstable and will cause performance issues and instance outages.
    This is on top of the intrinsic performance and volume inefficiencies involved with XML.
    If you store data in a (column,row) of a SQL table it needs to be atomic with respect to the context of the database. Hiding information inside XML in a column of a table means your data is no longer even in 1st normal form. Surely we can all agree that is a Bad Idea and contrary to any concept of good practise, at this late stage.
    Furthermore querying XML structures is complex, slow and inflexible due to the asymetric nature of hierarchies. And once your information is in it, you're stuck with the incompleteness of XPath and the inefficiency of XQuery. All the indices in the world won't save you.
    More still, it is almost impossible, and very expensive to constrain the data in the XML other than trivial domain and "data type" constraints. The constraints require procedural validation and are not immediate. So you can kiss goodbye to referential integrity and consistency even if you figure out how to implement them.
    Also "abstract clob" XMLType storage requires multiple full document copies for read consistency purposes, so you will cripple your instance and your storage overhead (typically rather kindly benchmarked at 3 times SQL volume) will exponentially run away.
    Just don't do it.

  • Difference between an XMLType table and a table with an XMLType column?

    Hi all,
    Still trying to get my mind around all this XML stuff.
    Can someone concisely explain the difference between:
    create table this_is_xmltype_tab of xmltype;and
    create table this_is_tab_w_xmltpe_col(id number, document xmltype);What are the relative advantages and disadvantages of each approach? How do they really differ?
    Thanks,
    -Mark

    There is another pointer Mark, that I realized when I was thinking about the differences...
    If you would look up in the manual regarding "xdb:annotations" you would learn about a method using an XML Schema to generate out of the box your whole design in terms of physical layout and/or design principles. In my mind this should be the preferred solution if you are dealing with very complex XML Schema environments. Taking your XML Schema as your single point design layout, that during the actual implementation automatically generates and builds all your needed database objects and its physical requirements, has great advantages in points of design version management etc., but...
    ...it will create automatically an XMLType table (based on OR, Binary XML of "hybrid" storage principles, aka the ones that are XML Schema driven) and not AFAIK a XMLtype column structure: so as in "our" case a table with a id column and a xmltype column.
    In principle you could relationally relate to this as:
    +"I have created an EER diagram and a Physical diagram, I mix the content/info of those two into one diagram." "Then I _+execute+_ it in the database and the end result will be an database user/schema that has all the xxxx amount of physical objects I need, the way I want it to be...".+
    ...but it will be in the form of an XMLType table structure...
    xdb:annotations can be used to create things like:
    - enforce database/company naming conventions
    - DOM validation enabled or not
    - automatic IOT or BTree index creation (for instance in OR XMLType storage)
    - sort search order enforced or not
    - default tablenames and owners
    - extra column or table property settings like for partitioning XML data
    - database encoding/mapping used for SQL and binary storage
    - avoid automatic creation of Oracle objects (tables/types/etc), for instance, via xdb:defaultTable="" annotations
    - etc...
    See here for more info: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#ADXDB4519
    and / or for more detailed info:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#i1030452
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#i1030995
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#CHDCEBAG
    ...

  • (updating xml value)adding an element in an xml type column

    Hi all,
    i hava a table that contains an xml-Type column (non schema based)
    i have inserted some data in it
    table:(id,xmlcolumn)
    ex:
    insert into t1 values(1,'<Chapters>
    <Chapter>ch1<Chapter>
    <Chapter>ch2<Chapter>
    </Chapters>')
    i need to add a new Chapter: <Chapter>ch3</Chapter>
    for the result of xml instance in the table to be:
    <Chapters>
    <Chapter>ch1<Chapter>
    <Chapter>ch2<Chapter>
    <Chapter>ch3<Chapter>
    </Chapters>
    plz if any one colud help

    SQL> DECLARE
      2      l_xml      XMLTYPE := XMLTYPE('<Chapters>
      3  <Chapter>ch1</Chapter>
      4  <Chapter>ch2</Chapter>
      5  </Chapters>');
      6      l_xsl      XMLTYPE;
      7      l_new_node VARCHAR2(100) := '<Chapter>ch3</Chapter>';
      8  BEGIN
      9      dbms_output.put_line('Before adding node:');
    10      dbms_output.put_line('----------------------------------------------------------------');
    11      dbms_output.put_line(l_xml.getStringVal());
    12      dbms_output.put_line('----------------------------------------------------------------');
    13      l_xsl := XMLTYPE('<?xml version="1.0"?>' ||
    14                       '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"' ||
    15                       ' version="1.0"' || ' result-ns=""' || ' indent="no">' ||
    16                       '<xsl:output method="xml" media-type="text/xml" indent="no"/>' ||
    17                       '<xsl:template match="/">' ||
    18                           '<' ||l_xml.getRootElement() || '>' ||
    19                               ' <xsl:for-each select="/' || l_xml.getRootElement() ||'/Chapter">' ||
    20                                   '<xsl:copy-of select="." />' ||
    21                               '</xsl:for-each>' ||
    22                               l_new_node ||
    23                           '</' || l_xml.getRootElement() || '>' ||
    24                       '</xsl:template>' ||
    25                       '</xsl:stylesheet>');
    26      l_xml := l_xml.Transform(l_xsl);
    27      dbms_output.put_line('After adding node:');
    28      dbms_output.put_line('----------------------------------------------------------------');
    29      dbms_output.put_line(l_xml.getStringVal());
    30      dbms_output.put_line('----------------------------------------------------------------');
    31  END;
    32  /
    Before adding node:
    <Chapters>
    <Chapter>ch1</Chapter>
    <Chapter>ch2</Chapter>
    </Chapters>
    After adding node:
    <Chapters>
      <Chapter>ch1</Chapter>
      <Chapter>ch2</Chapter>
      <Chapter>ch3</Chapter>
    </Chapters>
    PL/SQL procedure successfully completed.
    SQL>

  • Inserting a row in a schema-based xml type column

    i have problems while inserting a row in a schema-based xml type column
    it reports an error(schema and elemnt do not match)
    although they are matching if anyone can try it
    and if it worked plz send me the example

    SQL> DESC XML_TAB;
    Name Null? Type
    XML XMLTYPE
    SQL> INSERT INTO XML_TAB
    2 VALUES
    3 (xmltype('<request>
    4 <filter>(extshortname=bhagat)</filter>
    5 <attributes>dn</attributes>
    6 <context/>
    7 <scope>subtree</scope>
    8 </request>'));
    1 row created.
    If your problem persists,post ur lines of code..
    Good luck!!!
    Bhagat

  • What index is suitable for a table with no unique columns and no primary key

    alpha
    beta 
    gamma
    col1
    col2
    col3
    100
    1
    -1
    a
    b
    c
    100
    1
    -2
    d
    e
    f
    101
    1
    -2
    t
    t
    y
    102
    2
    1
    j
    k
    l
    Sample data above  and below is the dataype for each one of them
    alpha datatype- string 
    beta datatype-integer
    gamma datatype-integer
    col1,col2,col3 are all string datatypes. 
    Note:columns are not unique and we would be using alpha,beta,gamma to uniquely identify a record .Now as you see my sample data this is in a table which doesnt have index .I would like to have a index created covering these columns (alpha,beta,gamma) .I
    beleive that creating clustered index having covering columns will be better.
    What would you recommend the index type should be here in this case.Say data volume is 1 milion records and we always use the alpha,beta,gamma columns when we filiter or query records 
    what index is suitable for a table with no unique columns and primary key?
    col1
    col2
    col3
    Mudassar

    Many thanks for your explanation .
    When I tried querying using the below query on my heap table the sql server suggested to create NON CLUSTERED INDEX INCLUDING columns    ,[beta],[gamma] ,[col1] 
     ,[col2]     ,[col3]
    SELECT [alpha]
          ,[beta]
          ,[gamma]
          ,[col1]
          ,[col2]
          ,[col3]
      FROM [TEST].[dbo].[Test]
    where   [alpha]='10100'
    My question is why it didn't suggest Clustered INDEX and chose NON clustered index ?
    Mudassar

  • Cartesian of data from two tables with no matching columns

    Hello,
    I was wondering – what’s the best way to create a Cartesian of data from two tables with no matching columns in such a way, so that there will be only a single SQL query generated?
    I am thinking about something like:
    for $COUNTRY in ns0: COUNTRY ()
    for $PROD in ns1:PROD()
    return <Results>
         <COUNTRY> {fn:data($COUNTRY/COUNTRY_NAME)} </COUNTRY>
         <PROD> {fn:data($PROD/PROD_NAME)} </PROD>
    </Results>
    And the expected result is combination of all COUNTRY_NAMEs with all PROD_NAMEs.
    What I’ve noticed when checking query plan is that DSP will execute two queries to have the results – one for COUNTRY_NAME and another one for PROD_NAME. Which in general results in not the best performance ;-)
    What I’ve noticed also is that when I add something like:
    where COUNTRY_NAME != PROD_NAME
    everything is ok and there is only one query created (it's red in the Query plan, but still it's ok from my pov). Still it looks to me more like a workaround, not a real best approach. I may be wrong though...
    So the question is – what’s the suggested approach for such queries?
    Thanks,
    Leszek
    Edited by xnts at 11/19/2007 10:54 AM

    Which in general results in not the best performanceI disagree. Only for two tables with very few rows, would a single sql statement give better performance.
    Suppose there are 10,000 rows in each table - the cross-product will result in 100 million rows. Sounds like a bad idea. For this reason, DSP will not push a cross-product to a database. It will get the rows from each table in separate sql statements (retrieving only 20,000 rows) and then produce the cross-product itself.
    If you want to execute sql with cross-products, you can create a sql-statement based dataservice. I recommend against doing so.

  • Updating xml type column

    Hi,
    I have a xml type column with content as follows
    <?xml version="1.0" encoding="utf-8"?>
    <PartInformation PartNumber="4393">
    <Maintenance />
    <Details>
    <Specs PartNumber="4393">
    <Type Code="K"></Type>
    </Specs>
    </Details>
    </PartInformation>
    <PartInformation PartNumber="4395">
    <Maintenance />
    <Details>
    <Specs PartNumber="4395">
    <Type Code="Z"></Type>
    </Specs>
    </Details>
    </PartInformation>
    I want to update the PartNumber="4393" to PartNumber="5789" for every occurrence .
    What is the easiest way to do it?
    Thanks

    Hi,
    Something like this?
    UPDATE your_table
    SET xmlcol = updatexml(xmlcol,'//*[@PartNumber="4393"]/@PartNumber','5789')
    WHERE ...

  • Loop at table with unspecified type but with where-condition

    Hi,
    Doing a loop over an internal table with unspecified type and in addition using a condtion may be done as follows: Thereby the
    condition would be "... WHERE parentid EQ i_nodeid" if the type of <it_htab> would be static. However dynamic specification of a component through bracketed character-type data objects is not possible.
    FIELD-SYMBOLS: <it_htab> TYPE STANDARD TABLE,
                                    <wa_htab> TYPE ANY,
                                    <parentid> TYPE rsparent.
      ASSIGN me->ref_htab->* TO <it_htab>.
      LOOP AT <it_htab> ASSIGNING <wa_htab>.
        ASSIGN COMPONENT 'PARENTID' OF STRUCTURE <wa_htab> TO <parentid>.
        CHECK <parentid> EQ i_nodeid.
      ENDLOOP.
    Since you have to loop over the whole table and to check within the loop whether the condition is fullfilled, this is rather bad for performance.
    Questions: Are there any tricks to do this better?
    Best Regards and Thank you,
    Ingo

    >
    Lalit Mohan Gupta wrote:
    > you can put the condition in the where clause....
    only if you have the upcoming 7.0 EhP2 (Kernel 7.02 or 7.20) the following dynamic where works:
    DATA cond_syntax TYPE string.
    cond_syntax = `parentid = i_nodeid`.
    LOOP AT <it_htab> ASSIGNING <wa_htab>
                           WHERE (cond_syntax).
    in older releases you would have to use program generation to achieve a dynamic where... .
    Kind regards,
    Hermann

  • Custom action with XML type input and output parameter.

    Hi,
    I want to develop custom action with xml type input and/or output parameter.
    Is there sample code for java side. How is the definition of input and/or output parameter and set/get methods?
    does it need special .jar file to develop custom action like this?
    Thanks.

    Cemil - yes, you can use XML data types.  Use the class
    com.sap.lhcommon.xml.XMLDataType
    for your parameter type.  Here is a snippet from a custom action we use to log XML (instead of just returning the #text node like the default logger does):
    public class XMLLogger extends ActionReflectionBase
        private String source;
        private String eventType;
        private String textMessage;
        private XMLDataType xmlMessage;
        public XMLLogger()
            log = new Logger("UserLog");
            source = DEFAULT_SOURCE;
            eventType = TYPE_INFO;
            textMessage = "";
            xmlMessage = new XMLDataType();
        public XMLDataType getXmlMessage()
            return xmlMessage;
        public void setXmlMessage(XMLDataType xmlMessage)
            this.xmlMessage = xmlMessage;
        public void Invoke(Transaction transaction, ILog ilog)
            StringBuffer sb = new StringBuffer();
            sb.append('[');
            sb.append(source);
            sb.append("] ");
            sb.append(textMessage);
            sb.append(XMLUtils.convertXmlToString(xmlMessage));
    XMLUtils is a helper class we wrote - it's just a bunch of standard Java XML boilerplate code.  The important part you need to know is XMLDataType.getDocument() will return an org.w3c.dom.Document.
    I hope that was enough information to help.
    -tim

  • Importing a table with a BLOB column is taking too long

    I am importing a user schema from 9i (9.2.0.6) database to 10g (10.2.1.0) database. One of the large tables (millions of records) with a BLOB column is taking too long to import (more that 24 hours). I have tried all the tricks I know to speed up the import. Here are some of the setting:
    1 - set buffer to 500 Mb
    2 - pre-created the table and turned off logging
    3 - set indexes=N
    4 - set constraints=N
    5 - I have 10 online redo logs with 200 MB each
    6 - Even turned off logging at the database level with disablelogging = true
    It is still taking too long loading the table with the BLOB column. The BLOB field contains PDF files.
    For your info:
    Computer: Sun v490 with 16 CPUs, solaris 10
    memory: 10 Gigabytes
    SGA: 4 Gigabytes

    Legatti,
    I have feedback=10000. However by monitoring the import, I know that its loading average of 130 records per minute. Which is very slow considering that the table contains close to two millions records.
    Thanks for your reply.

  • Import from database an internal table with generic Type : Web Dynpro ABAP

    Hi everyone,
    i have a requirement in which i'm asked to transfer data flow between two frameworks, from WD Component to another. The problem is that i have to transfer internal tables with generic types. i used the import/ export from database approache but in that way i get an error message saying "Object references and data references not yet supported".
    Here is my code to extract a generic internal table from memory.
        DATA l_table_f4 TYPE TABLE OF REF TO data.
      FIELD-SYMBOLS: <l_table_f4> TYPE STANDARD TABLE.
      DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
      DATA: ls_indx TYPE indx.
      lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lo_componentcontroller->fire_vh_search_action_evt( ).
      ASSIGN l_table_f4 TO <l_table_f4>.
    *-- Import table for Help F4
      IMPORT l_table_f4 TO <l_table_f4> FROM DATABASE indx(v1) TO ls_indx ID 'table_help_f4_ID'.
    The error message is desplayed when last instruction is executed " IMPORT l_table_f4...".
    I saw another post facing the same problem but never solved "Generic Type for import Database".
    Please can anyone help ?
    Thanks & Kind regards.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • How to create table with rows and columns in the layout mode?

    One of my friends advised me to develop my whole site on the
    layout mode as its better than the standard as he says
    but I couldnot make an ordinary table with rows and columns
    in th layout mode
    is there any one who can tell me how to?
    thanx alot

    Your friend is obviously not a reliable source of HTML
    information.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Mr.Ghost" <[email protected]> wrote in
    message
    news:f060vi$npp$[email protected]..
    > One of my friends advised me to develop my whole site on
    the layout mode
    > as its
    > better than the standard as he says
    > but I couldnot make an ordinary table with rows and
    columns in th layout
    > mode
    > is there any one who can tell me how to?
    > thanx alot
    >

  • Dynamic Table with XML Schema

    Hi, I am new to livecycle and wondering if there is any sample for setting up the dynamic table with XML schema so I can access the data through workbench's xpath. thanks.

    Ivor,
    Take a look at the samples shipped with Designer. For 8.2.1 release take a look at
    C:\Program Files\Adobe\LiveCycle Designer ES\8.2\EN\Samples\Forms\Purchase Order\Schema\Schema\Purchase Order.xsd
    and the form samples.
    Otherwise, forward a request to [email protected] I would be happy to send you a sample XDP with a dynamic table and a schema.
    Steve

Maybe you are looking for

  • Date Filter in report

    Hi I could not give date value as a parameter in the filter option of any report.It thows following error in different situations.But my object data type is datetime only.The errors are 1. Exception Message : ADC Server exception in OpenViewset). Sta

  • Can't open CS3 docs in CS4.

    I can't open an indesign doc made only a year ago. I have tried several but none of my old docs appear to open in CS4. Is there no backward compatibility? I am using the latest update version 6.0.3 557 on Vista x64. ray

  • How to download Pages for Mac OS X 10.6.8?

    Hi all, I have Mac OS X 10.6.8. Version 10.7.4 is required to be able to install Pages. Is an upgrade to Mountain Lion worth the money, and will it enable me to download Pages from the Apple Store? If not, is there a possibility to buy an older versi

  • Safari 7.0.1 does not load large images

    When I use safari and try to load an image with a resolution above, say, 2000x2000, I get a black box, sometimes with a grey area in the corner. The correct image displays for a brief moment, about a half second, but not enough for my viewing pleasur

  • Deleting items to the trash

    I accidently erased my HD and have now reset it using time machine. Now when I delete items, they no longer go to the trash, but say that they will simply be deleted immediately. What happened?