Fetch XML data stored in database table column dynamically

Hi All,
I am working as a SQL guy but never worked on XML in SQlbefore.
During some project work , we need to fetch value from xml stored in database column.
Problem is rowsof xml column arebit different and have different values.
Could anybody help me to build something dynamic to fetch all values from each row .
My data look like:
TEXT
<
RiskEndorsement><ExistingExposureSplitLimitsChange><NewRiskLimitSeq>536504</NewRiskLimitSeq><EffDate>11/1/2011</EffDate></ExistingExposureSplitLimitsChange></RiskEndorsement>
<
RiskEndorsement><MandatoryStateRateSplit><StateCode>NY</StateCode><EffDate>4/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement>
<
RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197608</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.890</ExModFactor><SplitDate>3/11/2012</SplitDate></NonAnniversaryExModSplit></RiskEndorsement>
<
RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197613</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.970</ExModFactor><SplitDate>1/13/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement>
<
RiskEndorsement><MandatoryStateRateSplit><StateCode>AL</StateCode><EffDate>7/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement>
<
RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>208975</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>230094357</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.8700</ExModFactor><SplitDate>1/1/2012</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement>
<
RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213467</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>2431638</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.6800</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement>
<
RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>213473</RiskBureauSeq><RiskIDStatusSeq>1615</RiskIDStatusSeq><RiskIDNbr>917661014</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.860</ExModFactor><SplitDate>10/1/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement>
<
RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213497</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>1146456</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.830</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement>
Andrew

Please post a concise and complete example. Include table DDL and sample data INSERT statements.
Cause the solution depends on your actual structure. Otherwise take a look at the
nodes() method.
E.g.
DECLARE @Sample TABLE
ID INT IDENTITY ,
Data XML
INSERT INTO @Sample
( Data )
VALUES ( '<RiskEndorsement><ExistingExposureSplitLimitsChange><NewRiskLimitSeq>536504</NewRiskLimitSeq><EffDate>11/1/2011</EffDate></ExistingExposureSplitLimitsChange></RiskEndorsement> ' ),
( '<RiskEndorsement><MandatoryStateRateSplit><StateCode>NY</StateCode><EffDate>4/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197608</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.890</ExModFactor><SplitDate>3/11/2012</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197613</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.970</ExModFactor><SplitDate>1/13/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><MandatoryStateRateSplit><StateCode>AL</StateCode><EffDate>7/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>208975</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>230094357</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.8700</ExModFactor><SplitDate>1/1/2012</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213467</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>2431638</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.6800</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>213473</RiskBureauSeq><RiskIDStatusSeq>1615</RiskIDStatusSeq><RiskIDNbr>917661014</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.860</ExModFactor><SplitDate>10/1/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213497</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>1146456</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.830</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' );
SELECT ID ,
ExistingExposureSplitLimitsChange.value('NewRiskLimitSeq[1]', 'INT') AS NewRiskLimitSeq ,
ExistingExposureSplitLimitsChange.value('EffDate[1]', 'DATE') AS EffDate
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/ExistingExposureSplitLimitsChange') A ( ExistingExposureSplitLimitsChange );
SELECT ID ,
MandatoryStateRateSplit.value('StateCode[1]', 'NVARCHAR(255)') AS StateCode ,
MandatoryStateRateSplit.value('EffDate[1]', 'DATE') AS EffDate
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/MandatoryStateRateSplit') A ( MandatoryStateRateSplit );
SELECT ID ,
NonAnniversaryExModSplit.value('RiskBureauSeq[1]', 'INT') AS RiskBureauSeq ,
NonAnniversaryExModSplit.value('RiskIDStatusSeq[1]', 'INT') AS RiskIDStatusSeq ,
NonAnniversaryExModSplit.value('RiskIDNbr[1]', 'INT') AS RiskIDNbr ,
NonAnniversaryExModSplit.value('ExModStatusSeq[1]', 'INT') AS ExModStatusSeq ,
NonAnniversaryExModSplit.value('ExModFactor[1]', 'FLOAT') AS ExModFactor ,
NonAnniversaryExModSplit.value('SplitDate[1]', 'NVARCHAR(255)') AS SplitDateText
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/NonAnniversaryExModSplit') A ( NonAnniversaryExModSplit );
SELECT ID ,
AnniversaryRatingDateSplit.value('RiskBureauSeq[1]', 'INT') AS RiskBureauSeq ,
AnniversaryRatingDateSplit.value('RiskIDStatusSeq[1]', 'INT') AS RiskIDStatusSeq ,
AnniversaryRatingDateSplit.value('RiskIDNbr[1]', 'INT') AS RiskIDNbr ,
AnniversaryRatingDateSplit.value('ExModStatusSeq[1]', 'INT') AS ExModStatusSeq ,
AnniversaryRatingDateSplit.value('ExModFactor[1]', 'FLOAT') AS ExModFactor ,
AnniversaryRatingDateSplit.value('SplitDate[1]', 'NVARCHAR(255)') AS SplitDateText
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/AnniversaryRatingDateSplit') A ( AnniversaryRatingDateSplit );

Similar Messages

  • Load xml data to oracle database table

    hi,
    i am facing some problem in fetching from xml data into oracle . That if the table column name and xsl and xsd tag are equal then data is fetching .
    if we we are changing column name in xsl and xsd then data is not fetching.
    the soure is like that
    XSD FILE
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
         </xs:complexType>
         <xs:complexType name="TRANSAC_Type">
    <xs:all>
    <xs:element name="NECRITUR" type="Char4_Type" minOccurs="0" nillable="false"/>
    <xs:element name="NPTF_INT" type="Char2_Type" minOccurs="0" nillable="false"/>
    </xs:all>
    </xs:complexType>
    <xs:simpleType name="Char1_Type">
    <xs:restriction base="xs:string">
    <xs:maxLength value="1"/>
    </xs:restriction>
    </xs:simpleType>
    XSL FILE
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:output method="xml" indent="yes"/>
    <!-- Treatment of fields for table -->
    <xsl:template match="NECRITUR">
    <NO_ECRIT_INT>
    <xsl:value-of select="."/>
    </NO_ECRIT_INT>
    </xsl:template>
    <xsl:template match="NPTF_INT">
    <NPTF_INT>
    <xsl:value-of select="."/>
    </NPTF_INT>
    </xsl:template>
    </xsl:template>
    </xsl:stylesheet>
    Xml file
    <File xmlns:xsi="http://www.’’’’’ ">
    <Header>
    <FileType>TRANSAC</FileType>
    <FileName>TRANSAC.XML</FileName>
    <CreationDate>2007-02-22</CreationDate>
    <CreationTime>14:56:48</CreationTime>
    </Header>
    <Data>
    <TRANSAC>
    <NECRITUR>6</NECRITUR>
    <NPTF_INT>MMMM</NPTF_INT>
    </TRANSAC>
    </Data>
    </File>
    Table Is
    REP (NO_ECRIT_INT, NPTF_INT, CreationDate, CreationTime)
    Regards
    manu
    Message was edited by:
    user561683

    Hi Manu
    Im not quite sure what your question is?
    Are you trying to load data to the database or
    Are you trying to retrieve data from the database ?
    Either way this forum is meant for XML Publisher or BI Publisher issues not just XSL ... you might be better asking on the XML forum.
    Regards, Tim

  • Capture XML data payload into database table (Oracle EBS R12)

    Hi All,
    We have a XML Publisher report which generates output in PDF format. We want to capture the XML data payload generated by this report and put it into a DB table once the PDF is generated.
    This report is generated through Oracle EBS R12 and XML Payload is stored by oracle by default in $APPLCSF/out directory.
    Any pointers would be helpful
    br

    Couple of options, this one is probably the easiest without knowing other requirements (e.g., do you have to store the output as XML, or do you just the data available so you can output in XML later?).
    Capture the SQL statement that generates the output in the first place. If you have that statement, you can insert into some table using the select statement. Once you have the report data (and you can tag that particular set of data with a job ID, timestamp, whatever, in case you need to store it and distinguish it from other reports down the road), you can generate XML output using the PL/SQL built-in DBMS_XMLGEN.
    Is that what you are looking for?

  • How to query XML data stored in a CLOB column

    I don't know XMLDB, so I have a dumb question about querying XML data which is saved as CLOB in a table.
    I have a table (OLAP_AW_PRC), with a CLOB column - AW_XML_TMPL_VAL
    This column contains this xml data - [click here|http://www.nasar.net/aw.xml]
    Now I want to query the data using the xml tags - like returning the name of AW. This is where I am having trouble, how to query the data from AW_XML_TMPL_VAL clob column.
    The following query generates error:
    ORA-31011: XML parsing failed.
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    SELECT
    extractValue(value(x), '/AW/LongName') as "AWNAME"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/Name') = 'OMCR4'
    - Nasar

    Mark,
    Thanks. This is exactly what I was looking for.
    After doing @Name in both places (SELECT and WHERE clause) it worked.
    Now I have one more question.
    There are multiple DIMENSION tags in my xml, and I want to see the NAME attribute values for all of those DIMENSIONs. The following query returns
    ORA-19025: EXTRACTVALUE returns value of only one node.
    Cause: Given XPath points to more than one node.
    Action: Rewrite the query so that exactly one node is returned.
    SELECT
    extractValue(value(x), '/AW/@Name') as "AW",
    extractValue(value(x), '/AW/Dimension/@Name') as "DIMENSIONS"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/@Name') = 'OMCR4'

  • How to load xml data into a database table....

    Hi All,
    Iam new to this forum.I have an xmldoc table of xmltype(datatype).Iam able to insert xml data to it.I have another table called new_books.sql:
    CREATE TABLE NEW_BOOKS
    TITLE          VARCHAR2(255) NOT NULL,
    LINK          VARCHAR2(80) NULL,
    PUBLISHER     VARCHAR2(255) NULL,
    SUBJECT     VARCHAR2(80) NULL,
    PUBDATE     VARCHAR2(40) NULL,
    DESCRIPTION     VARCHAR2(4000) NULL,
    AUTHOR     VARCHAR2(80) NULL,
    PRIMARY      KEY(TITLE)
    Now i want to copy the data in the xmldoc table into the table new_books.sql.Is there any procedure to do that in PL/SQL?
    Given below is the xmlfile:
    - <rdf>
    - <item>
    <title>Enterprise SOA: Designing IT for Business Innovation</title>
    <link>http://safari.oreilly.com/0596102380?a=102682</link>
    <publisher>O'Reilly</publisher>
    <creator>Thomas Mattern</creator>
    <creator>Dan Woods</creator>
    <subject>IT Infrastructure</subject>
    <date>April 2006</date>
    </item>
    </rdf>
    Thanks in Advance,
    Gita.

    Assuming the table xmldoc(of xmltype) has this XML
    SQL> select * from xmldoc;
    SYS_NC_ROWINFO$
    <rdf>
    <item>
    <title>Enterprise SOA: Designing IT for Business Innovation</title>
    <link>http://safari.oreilly.com/0596102380?a=102682</link>
    <publisher>O'Reilly</publisher>
    <creator>Thomas Mattern</creator>
    <creator>Dan Woods</creator>
    <subject>IT Infrastructure</subject>
    <date>April 2006</date>
    </item>
    </rdf>
    SQL> INSERT INTO NEW_BOOKS(TITLE, LINK, PUBLISHER, SUBJECT)
      2  select extractvalue(value(x),'/rdf/item/title') as title,
      3  extractvalue(value(x),'/rdf/item/link') as link,
      4  extractvalue(value(x),'/rdf/item/publisher') as publisher,
      5  extractvalue(value(x),'/rdf/item/subject') as subject
      6  from xmldoc x
      7  ;
    1 row created.

  • Mapping XML data to relational database tables

    I'm writing an application that has two parts: the client part generates XML documents and sends them across the network to a server part, which parses the XML, maps the XML to various RDBMS tables and stores the data in the RDBMS.
    I've got everything working using SAX, but now any change I make to the XML schema and/or the RDBMS table structures in the future will mean some serious code changes.
    Has anyone worked with this scenario and developed a better method of handling this mapping? All the previous efforts in this area seem to be RDBMS to XML, which is of no use to me.
    If you had to do this this, how would you approach it? I'm using XML for ease of reading, as the client has code to allow for documents to be written to the disk if no connection to the server is available, and the server does the same if no database connection is available.
    Thanks in advance ...
    cheers,
    mark

    OK, to reply to my own posting for future reference, I've found an open source project called Osage at http://sourceforge.net that does what I need. I'm looking at it now and can't say if it's everything I want, but it seems likely to fit the bil.
    cheers,
    mark

  • Trying to Insert an XML Element into XML data stored in CLOB column

    Hi all,
    My ORACLE DB version is:
    ('Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production');
    ('PL/SQL Release 11.2.0.2.0 - Production');
    ('CORE 11.2.0.2.0 Production');
    ('TNS for Linux: Version 11.2.0.2.0 - Production');
    ('NLSRTL Version 11.2.0.2.0 - Production');
    I have this XML data stored in a CLOB column:
    <Activity>
         <Changes>     
         </Changes>
         <Inserts>     
         </Inserts>
         <Definition>     
         </Definition>
         <Assignment TYPE="Apply">     
         </Assignment>
         <Spawned>
              <Activity>576D8CD9-57A1-8608-1563-8F6DC74BDF3C</Activity>
              <Activity>11226E79-5D24-02EB-A950-D34A9CCFB3FF</Activity>
              <Activity>DAA68DC0-CA9A-BB15-DE31-9596E19513EE</Activity>
              <Activity>93F667D6-966A-7EAD-9B70-630D9BEFDDD2</Activity>
              <Activity>FA63D9D3-86BB-3FF0-BE69-17EAA7581637</Activity>
         </Spawned>
         <SpawnedBy>AFC49BD4-5AA7-38C0-AE27-F59D16EE1B1C</SpawnedBy>
    </Activity>
    I am in need of some assistance in creating an update that will insert another <Activity>SomeGUID</Activity> into the <Spawned> parent.
    Any help is greatly appreciated.
    Thanks.
    Edited by: 943783 on Dec 14, 2012 12:58 PM

    See XML updating functions : http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb04cre.htm#i1032611
    For example :
    UPDATE my_table t
    SET t.my_clob =
          XMLSerialize(document
            insertChildXML(
              XMLParse(document t.my_clob)
            , '/Activity/Spawned'
            , 'Activity'
            , XMLElement("Activity", 'Some GUID')
    WHERE ...
    ;Although it works, there's overhead introduced by parsing the CLOB, then serializing again.
    Is there any chance you can change the CLOB to SECUREFILE binary XMLType storage instead?
    You would then be able to benefit from optimized piecewise update of the XML and improved storage.

  • Read table data and fetch file from path specified in table column

    Hi,
    I have a situation where file path information is stored in database table along with other columns - I need to read data from SQL Server table row by row, go to the path identified by the record, check for existance of the file - if the file is available copy it to a staging area, then read the next record. Repeat this process until the last record is fetched from the table. At the end, zip all the files found and FTP to a different location. If the file is not found in the path specified, write the database record to a seperate text file.
    At end of the process, send an email with records for which files were not found at specified location.
    Thanks
    Edited by: user4566019 on Oct 5, 2008 4:32 AM

    Hi,
    That is not complex to solve at ODI.
    Try the following.
    1) Create a package
    2) create a variable to receive the path as parameter and drag and drop it at package as "Declared"
    3) drag and drop the ODI Tool "odiFileMove" using and let the variable as patch at ODI Tool parameter.
    Use the parameters -ACTION=MOVE -TIMEOUT=100 and -NOFILE_ERROR=NO (take a look at ODI Toos Reference for other parameters)
    3) Create a "KO" (error) flow to write the variable at a text file. That will allow the process knows what file is missing
    4) generate a scenario of this package
    5) create a procedure
    6) at first step, put the query from SQL Server (set the Logical Schema to the right connection)
    7) at Target tab, put the call to the scenario generated using the returned value from query parameter. Plus, let the -SYNC_MODE=1. That will call one scenario by time.
    8) create a new step to zip the files at stage directory
    9) create a step to make the ftp
    10) create a step to mail the txt generated with files not founded. If you wish, you can make a validation on the file to see if is necessary to send the mail, it means, if there is any file missing.
    Does it help you?

  • When / why use XML to store data instead of database table ?

    Hi All,
    I still not use XML much in applications and don't know much about its utilization.
    I read here and there about storing data as XML instead of into database tables.
    - could any body please tell me when / why use XML to store data instead of database table ?
    e.g : store inventory per warehouse in XML format. ?
    - What is the other cases or reasons of extracting database records into XML or vice versa ?
    - is there any good pdf on this ?
    Thank you for your help,
    xtanto

    It depends entirely what you want to accomplish with the 'XML in the database'. There are basically 3 independent methods: As CLOB, as XMLType views or as native XMLType 'columns'
    Each method has advantages and disadvantages, especially in the performance vs purpose tradeoff.
    The Oracled Press book "Oracle Database 10g XML & SQL Design, Build, & Manage XML Applications in Java, C, C++, & PL/SQL" is highly recommended for anyone interested in Oracle and XML. http://books.mcgraw-hill.com/getbook.php?isbn=0072229527&template=oraclepress

  • Update XML data stored in CLOB Column

    Hi All,
    i am new to Oracle and new to SQL
    i am trying to update XML data stored in CLOB cloumn,data is stored with the follwoing format
    <attrs><attr name="name"><string>Schade</string></attr></attrs>
    i am using the following query for updating the value
    UPDATE PRODUCT p SET ATTRIBUTES_nl_nl=UPDATEXML(XMLTYPE.createXML(ATTRIBUTES_nl_nl),'/attrs/attr[@name="name"]/string/text()','Schade').getClobVal() WHERE p.sku='000000000000040576_200911-5010057'
    this query is working fine but it changing the data to the following format
    <attrs><attr name="name">Schade</attr></attrs>
    some how it is ommiting the <string> tag from it, i am unable to figure it out whats the reason.
    any help in this regard will b e much appriciated
    Thanks in Advance
    -Umesh

    Hi,
    You should have created your own thread for this, and included database version.
    This works for me on 11.2.0.2 and 10.2.0.5 :
    SQL> create table t_org ( xml_clob clob );
    Table created
    SQL>
    SQL> insert into t_org
      2  values(
      3  '<Message>
      4  <Entity>
      5  <ASSIGNMENT>
      6  <OAVendorLocation> </OAVendorLocation>
      7  <Vendorid>1</Vendorid>
      8  </ASSIGNMENT>
      9  </Entity>
    10  </Message>'
    11  );
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select '*' ||
      2         extractvalue(xmltype(xml_clob),'/Message/Entity/ASSIGNMENT/OAVendorLocation')
      3         || '*' as result
      4  from t_org;
    RESULT
    SQL> update t_org set xml_clob =
      2  updatexml(xmltype(xml_clob),
      3  '/Message/Entity/ASSIGNMENT/OAVendorLocation/text()','LONDON').getClobVal()
      4  ;
    1 row updated
    SQL> select '*' ||
      2         extractvalue(xmltype(xml_clob),'/Message/Entity/ASSIGNMENT/OAVendorLocation')
      3         || '*' as result
      4  from t_org;
    RESULT
    *LONDON*
    Does the OAVendorLocation really have a whitespace value?
    If not then it's expected behaviour, you're trying to update a text() node that doesn't exist. In this case, the solution is to use appendChildXML to create the text() node, or update the whole element.
    Is it your real document? Do you actually have some namespaces?

  • How to input data in a database table without knowing in advance table and column configurations

    Hi,
    I have a problem using LabVIEW for input data (manually) in a SQL database. I have about 40 tables in the database, each of them is related to a specific engine component. I need to create a user interface (maybe visualizing the table with a table control) where the users can insert data in the database table fields. Could someone give me some suggestion on how to do it?
    Using the  DB tools insert data.vi I need to know in advance the column configuration of the table, but in my database each table has its own structure! So do I have to create 40 different masks, one for every different table?
    Thanks in advance.
    Michela

    I have not actually used the LV SQL Toolkit, but I will try and offer high level ideas :-)
    when you have retrieved the construction data for a table, you should be able to use array and cluster indexing to aquire the names of the fieds, enough to create a labelled table on the LV Front panel.
    After completing a new entry you can INSERT the entry into the database using the same data.
    Is the SQL toolkit an additional purchase, or included in newer versions as standard? If you post a sample of the cluster/array that you retrieve, I could give you a sample VI to give you some pointers in creating the User Interface table 
    - Cheers, Ed

  • How to fetch data from single database table using 2 internal tables.

    Hi friends,
    i am a new user of ABAP and also SDN.
    i need a help. 
    i want to fetch data from one database table based on primary keys of 2 internal tables.  how to put in where clause.
    Thanks in advance.

    hii
    refer to following code ..i hope it will help you
    SELECT matnr                         " Material Number
        FROM mara
        INTO TABLE i_mara
       WHERE matnr IN s_matnr.
      IF i_mara[] IS NOT INITIAL.
        SELECT matnr                       " Material Number
               werks                       " Plants
               prctr                       " Profit Center
          FROM marc
          INTO TABLE i_marc
           FOR ALL ENTRIES IN i_mara
         WHERE matnr = i_mara-matnr
           AND werks IN s_werks.
      ENDIF.                               " IF i_mara[] IS NOT INITIAL
      i_output = i_marc.
      IF i_marc[] IS NOT INITIAL.
        SELECT matnr                       " Material Number
               werks                       " Plants
               lgort                       " Storage Location
          FROM mard
          INTO TABLE i_mard
           FOR ALL ENTRIES IN i_marc
         WHERE matnr EQ i_marc-matnr
           AND werks EQ i_marc-werks
           AND lgort IN s_lgort.
      ENDIF.                               " IF i_mara[] IS NOT INITIAL
    regards
    twinkal

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

  • Read xml-structure from a xml-document stored in a xmltype-column?

    Hello,
    I have several xml-documents stored in a table with a xmltype-column.
    Is it possible to read the structure of one xml-document? I need to know what data are exists in the xml-documents.
    I had read some hours here, but I dont find a suitable solution for that.
    To make a example, what I need:
    I have stored the following xml-document in the table:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="6">
    <EMPLOYEE_ID>105</EMPLOYEE_ID>
    <FIRST_NAME>David</FIRST_NAME>
    <LAST_NAME>Austin</LAST_NAME>
    <EMAIL>DAUSTIN</EMAIL>
    <PHONE_NUMBER>590.423.4569</PHONE_NUMBER>
    <HIRE_DATE>6/25/1997 0:0:0</HIRE_DATE>
    <JOB_ID>IT_PROG</JOB_ID>
    <SALARY>4800</SALARY>
    <MANAGER_ID>103</MANAGER_ID>
    <DEPARTMENT_ID>60</DEPARTMENT_ID>
    </ROW>
    </ROWSET>
    I need to return the following:
    ROWSET
    ...ROW
    ......EMPLOYEE NUMBER
    ......FIRST_NAME VARCHAR2
    ......DEPARTMENT_ID NUMBER
    Regards,
    Mark

    Hi,
    I was on a wrong way. The datatype is not stored in xml, this was a mistake from me.
    I needed something to printout some values from a xml-file. This xml-file was generated bei MS Excel. The data are in /Workbook/Worksheet/Table/Cell and I didnt know how to access it.
    I write for that the following:
    DECLARE
    v_xml XMLType;
    v_doc dbms_xmldom.DOMDocument;
    v_node dbms_xmldom.DOMNode;
    type t_values is table of varchar2(2000) index by binary_integer;
    v_values t_values;
    type t_table is table of t_values index by binary_integer;
    v_table t_table;
    procedure node_output (v_node in out dbms_xmldom.DOMNode)
    is
    v_nodelist1 DBMS_XMLDOM.DOMNodeList;
    v_nodelist2 DBMS_XMLDOM.DOMNodeList;
    v_anzahlnodes number;
    v_anzahlrows number;
    v_node_c dbms_xmldom.DOMNode;
    v_xmlmitarbeiterid number;
    begin
    v_nodelist1 := dbms_xmldom.GETCHILDNODES(v_node);
    v_anzahlrows := DBMS_XMLDOM.GETLENGTH(v_nodelist1);
    if v_anzahlrows = 0 or DBMS_XMLDOM.GETNODENAME(v_node) = 'Table'
    then
    if v_anzahlrows > 0
    then
    for i1 in 0..v_anzahlrows - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist1,i1);
    v_nodelist2 := dbms_xmldom.GETCHILDNODES(v_node);
    v_anzahlnodes := DBMS_XMLDOM.GETLENGTH(v_nodelist2);
    for i2 in 0..v_anzahlnodes - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist2,i2);
    v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node);
    v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node_c);
    v_values(i2) := DBMS_XMLDOM.GETNODEVALUE(v_node_c);
    end loop;
    v_table(i1) := v_values;
    end loop;
    for i1 in 1..v_anzahlrows - 1
    loop
    select SEQ_XMLMITARBEITER.nextval into v_xmlmitarbeiterid from dual;
    for i2 in 1..v_table(i1).count - 1
    loop
    dbms_output.put_line(v_table(i1)(i2));
    end loop;
    end loop;
    end if;
    else
    v_node := dbms_xmldom.GETFIRSTCHILD(v_node);
    for i in 0..v_anzahlrows - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist1,i);
    node_output(v_node);
    end loop;
    end if;
    end;
    BEGIN
    select inhalt into v_xml FROM xmlimport WHERE name = 'F23973/mitarbeiter.xml';
    v_doc := dbms_xmldom.newDOMDocument(v_xml);
    v_node:= dbms_xmldom.makeNode(dbms_xmldom.getDocumentElement(v_doc));
    node_output(v_node);
    END;
    This gives me all data from a xml-Excel-file. Is there a better way to do that? I have Oracle 10.2.
    Regards,
    Mark

  • Fetch XML data from CLOB

    Hi,
    I'm very new in Oracle. I have DB running on oracle 9i. On production DB one tablespace have CLOB datatype and this CLOB field have all techinal stuff stored in XML format. How DO I fetch this info?
    select info from infotbl; showing all the XML junk.
    what is the batter way to fetch XML data properly

    Difficult to give the exact answer without knowing which node repeats..
    Howver it will be something like this
    select extractValue(value(x),'/RepeatingNode/NonRepatingNode/NonRepeatingNode)
      from TABLE, table(xmlsequence(extract(xmltype(clob),'/Root/Node/RepeatingNode')))) x

Maybe you are looking for

  • Optical Drive makes noise twice on startup

    Hi all, This problem first appeared when I first changed my RAM from 4GB to 8GB last year. After a year, the RAM broke down, failed the hardware test. I replaced it and though the hardware test is passed, the optical drive noise issue persists. The p

  • Can't figure how to remove the Express Rail Kit X8029A-EZ

    I feel really stupid for asking this, but I can't figure out how to remove the express rail kit from my rack. I got it installed in a snap, but I can't figure out how to remove it. I think the model number is X8029A-EZ, but I can't find any docs on i

  • T-code ME23 - Show GR and IR matched together - GR/IR Assgt

    When we look at scheduling (outline??) agreements (ME33) history, one of the choices from the toolbar is "GR/IR Assgt".  That option shows a grouped display of the GR's and IR's for an agreement, with matched GR's and IR's shown together as a group,

  • Re: fill-in boxes

    Does anyone know if their is a way to leave out or delete the fill-in boxes when creating a form in the FREE version of Adobe Acrobat?

  • Adobe DNG settings for Lumix DMC-LX1 workaround

    The question is for Pat Gilmore, who originally posted the workaround: Pat, I followed all your steps, but in Step 4 when I try to access the URL (where I will find out how to set the DNG preferences) I get this message: The requested URL /users/pat/