How to store XML and search within tags

My question
===========
exactly what steps do you need follow to take an XML doc, store
it, and query based on a tag value.
The 8i Intermedia text option Reference refers to
XLM_SECTION_GROUP feature. However, no examples are given. There
is no user guide.
I searched Oracle's website and found one reference to
XML_SECTION_GROUP. The example given is a single row insert into
a CLOB column with a single pair of tags.
This whitepaper gives an example of an XML doc, and a query on
it:
XML Support in Oracle8i and Beyond
November 9, 1998
It doesn't list the steps in between storing the doc and quering
it. This is crucial to the whole thing: does XML_SECTION_GROUP
allow all nested tags below the top level to be sectioned and
indexed implicitly? Or do you need to tell Oracle about all the
tags you are interested in, in which case what value is added by
the XLM_SECTION_GROUP?
Does Oracle have some better examples on this?
Below is text cut and pasted from the whitepaper.
-----------x---------
Figure 5: InsuranceClaim Mixes Structured Data and Text
<?xml version="1.0"?>
<InsuranceClaim>
<ClaimID>12345</ClaimID>
<LossCategory>7</LossCategory>
<Settlements>
<Payment>
<Payee>Borden Real Estate</Payee>
<Date>12-OCT-1998</Date>
<Amount>200000</Amount>
<Approver>JCOX</Approver>
</Payment>
</Settlements>
<DamageReport>
A massive <Cause>Fire</Cause> ravaged the building
and
<Casualties>12</Casualties> people were killed.
Early
FBI reports indicate that <Motive>arson</Motive> is
suspected.
</DamageReport>
</InsuranceClaim>
Once instances of iFS file types (including XML-based ones) are
stored in the database, their
content can be searched using standard SQL queries, and these
files can be organized, browsed,
and versioned using familiar tools like the Windows Explorer.
So an insurance agent sees a
directory of InsuranceClaim files sheFs recently worked on in
the field, while an
InsuranceClaim-processing application developer can work with
the information in the
InsuranceClaim in any way he needs to.
XML-Enabled "Section Searches" in ConText
Any XML documents or document fragments saved into "text blobs"
in the database can be
enabled for indexing by Oracle8i InterMediaFs ConText
text-search engine. ConText has been
enhanced for Oracle8i to allow developers to pinpoint their
searches to a particular section of a
document, where sections are implicitly defined by the XML tags
in the document (fragment).
Since ConText is seamlessly integrated into the database and
the SQL language, developers can
use SQL to perform queries that involve both structured data
and indexed document fragments.
For example, Figure 6 shows the SQL statement you would write
to search one million
Insurance Claims in your database to answer the question, "How
much money has Jim Cox
approved to date in settlement payments for arson-related fire
claims? "
Figure 6: Searching on a Column & Text in XML
Sections
SELECT SUM(Amount)
FROM Claim_Header ch,
Claim_Settlements cs,
Claim_Settlement_Payments csp
WHERE csp.Approver = 'JCOX'
AND CONTAINS (DamageReport, 'Arson WITHIN Motive') >
0
AND CONTAINS (DamageReport, 'Fire WITHIN Cause' ) >
0
AND . . . /* Join Clauses */
null

Geoff Ingram (guest) wrote:
: My question
: ===========
: exactly what steps do you need follow to take an XML doc,
store
: it, and query based on a tag value.
: The 8i Intermedia text option Reference refers to
: XLM_SECTION_GROUP feature. However, no examples are given.
There
: is no user guide.
: I searched Oracle's website and found one reference to
: XML_SECTION_GROUP. The example given is a single row insert
into
: a CLOB column with a single pair of tags.
: This whitepaper gives an example of an XML doc, and a query on
: it:
: XML Support in Oracle8i and Beyond
: November 9, 1998
: It doesn't list the steps in between storing the doc and
quering
: it. This is crucial to the whole thing: does XML_SECTION_GROUP
: allow all nested tags below the top level to be sectioned and
: indexed implicitly? Or do you need to tell Oracle about all
the
: tags you are interested in, in which case what value is added
by
: the XLM_SECTION_GROUP?
: Does Oracle have some better examples on this?
: Below is text cut and pasted from the whitepaper.
: -----------x---------
: Figure 5: InsuranceClaim Mixes Structured Data and Text
: <?xml version="1.0"?>
: <InsuranceClaim>
: <ClaimID>12345</ClaimID>
: <LossCategory>7</LossCategory>
: <Settlements>
: <Payment>
: <Payee>Borden Real Estate</Payee>
: <Date>12-OCT-1998</Date>
: <Amount>200000</Amount>
: <Approver>JCOX</Approver>
: </Payment>
: </Settlements>
: <DamageReport>
: A massive <Cause>Fire</Cause> ravaged the building
: and
: <Casualties>12</Casualties> people were killed.
: Early
: FBI reports indicate that <Motive>arson</Motive> is
: suspected.
: </DamageReport>
: </InsuranceClaim>
: Once instances of iFS file types (including XML-based ones)
are
: stored in the database, their
: content can be searched using standard SQL queries, and
these
: files can be organized, browsed,
: and versioned using familiar tools like the Windows
Explorer.
: So an insurance agent sees a
: directory of InsuranceClaim files sheFs recently worked on
in
: the field, while an
: InsuranceClaim-processing application developer can work
with
: the information in the
: InsuranceClaim in any way he needs to.
: XML-Enabled "Section Searches" in ConText
: Any XML documents or document fragments saved into "text
blobs"
: in the database can be
: enabled for indexing by Oracle8i InterMediaFs ConText
: text-search engine. ConText has been
: enhanced for Oracle8i to allow developers to pinpoint their
: searches to a particular section of a
: document, where sections are implicitly defined by the XML
tags
: in the document (fragment).
: Since ConText is seamlessly integrated into the database and
: the SQL language, developers can
: use SQL to perform queries that involve both structured data
: and indexed document fragments.
: For example, Figure 6 shows the SQL statement you would
write
: to search one million
: Insurance Claims in your database to answer the
question, "How
: much money has Jim Cox
: approved to date in settlement payments for arson-related
fire
: claims? "
: Figure 6: Searching on a Column & Text in XML
: Sections
: SELECT SUM(Amount)
: FROM Claim_Header ch,
: Claim_Settlements cs,
: Claim_Settlement_Payments csp
: WHERE csp.Approver = 'JCOX'
: AND CONTAINS (DamageReport, 'Arson WITHIN Motive') >
: 0
: AND CONTAINS (DamageReport, 'Fire WITHIN Cause' ) >
: 0
: AND . . . /* Join Clauses */
Currently you cannot break apart an arbitrary XML doc and store
it into the database without using XSLT to create DDL to insert
it. You can create a schema and have XML be read and written to
it. Check out the XML SQL Utility available here for download.
As for the section searching, in 8.1.5 you can only get section
searching not hierarchical searches. interMedia in this version
doesn't understand the XML structure. This will come in 8.1.6.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • How to store receipes and print them?

    How to store receipes and print them?

    If you download and install Adobe Reader for your iPad or iPhone, you could download recipes in the PDF format and store them. If you have an AirPrint-compatible printer, you could print them to your device.

  • How to store ,retreive and edit  data from an xml file

    I am new to XML. I am creating a phone book in JSP with backend as an XML file.How can I store retrieve and edit datas from a jsp file.
    Please provide me with examples.I dont want to use bean.
    Please provide examples

    You will have to do some leg-work yourself. You will probably want to use DOM to parse and manipulate your XML data. Xerces (xml.apache.org) is a good open source parser. There are extensive examples on their site.
    - Saish

  • How do you find and replace "within selected text" in a textedit document (version 1.8, mountain lion)

    In the textedit version on Snow leopard it was possible to search and replace within a peice of selected text only i.e. not the entire file. This was a very useful feature because you could select a paragraph and replace all occurences of word1 with word2 within that paragraph only! This feature appears to be missing from the mountain lion version of textedit (version 1.8). Or can anyone tell me how to do it ... ?

    Having 46 people view a post without replying is not unusual. Some people look at a question to see if it's something they'd like to know the answer to, and then come back  when it has eventually been answered.
    I'm not sure if you need to escape forward slashes in Dreamweaver's Find and Replace dialog box, but I normally do because both JavaScript and PHP normally use forward slashes as delimiters to mark the beginning and end of the regex like this:
    var pattern = /[A-Z]{4}/; // JavaScript
    $pattern = '/[A-Z]{4}/';   // PHP
    When a forward slash appears inside the regex, you need to escape it with a backslash to avoid confusion with the closing delimiter.
    As you have worked out, a capturing group is created by wrapping part of the regex in parentheses.
    If you want to match exactly 38 characters, you can use [\S\s]{38}. That includes spaces, newline characters, symbols, everything.
    If you're trying to find everything between two tags, you can do this:
    (<\/tag_name>)([^<]+)
    The closing tag is captured as $1 and everything up to the next opening tag is captured as $2.
    Learning regular expressions is not easy. I don't claim to be an expert, but I enjoy the challenge of trying to solve them. If you're interested in regular expressions, there are several books published by O'Reilly. "Mastering Regular Expressions" is the ultimate authority, but it's a difficult read (not because it's badly written, but because of the complexity of the subject). "Regular Expressions Cookbook" is very good. There's also a new "Introducing Regular Expressions", but I haven't read it.

  • How To Store XML Fragments Using Functions Such As XMLElement

    Hi
    Not sure what I am missing. I wish to store XML fragments in variables so can pass around and concatenate with other fragments to make final XML document. Even before attempting to concatenate XML fragments, I am struggling to store any XML fragment in a variable. I am trying to use simple functions such as XMLElement to generate XML so can store in variable. I have seen many examples of XMLElement in SQL select statement. Can XMLElement be used in plsql? XMLElement says it returns value of type XMLType. Functions such as XMLElement make generating XML easier than creating all tags manually.
    Below is simple example that demonstrates what I would like to do. I would like to be able to pass the XML fragment as either XMLType or clob. I receive error saying PLS-00201: identifier 'XMLELEMENT' must be declared
    declare
    vTheData XMLType;
    vTheDataClob clob;
    begin
      vTheData:= XMLelement("empno",'1234567');
      vTheDataClob:= xmlelement("empno",'1234567').getclobval();
    end;
    Where as I can use below, but surely don't have to use select into from dual method. I just expect can use XMLElement function in plsql same as sql, such as most other functions eg length, rtrim etc.
    declare
    vTheData XMLType;
    vTheDataClob clob;
    begin
      select xmlelement("empno",'1234567')
      into vTheData
      from dual;
      select xmlelement("empno",'1234567').getclobval()
      into vTheDataClob
      from dual;
    end;
    Hope this makes sense.
    Thanks

    Having said that, is there a more elegant way to achieve below. That is populate two XML fragments and concatenate together.
    Sure, why not just only one statement?
    select XMLConcat(
             XMLElement( ... )
           , XMLElement( ... )
    into vTheResult
    from dual;
    As a second question, is it better to build and pass XML fragments as XMLType or clob?
    I would say stay with XMLType but it depends on your requirement.
    I generally avoid passing around pieces of data, SQL/XML functions are powerful in the way they can be used with set operations, so using them in a piecewise approach kinda negates what they're for.

  • How to store videos and photos in external storage

    Hi,
    May I know how do I store videos and photos into an external hard disk so that I can free up my Macbook storage?
    Hope to receive advice on this.
    Thanks
    Stephen Lim

    Hi Stephen
    Yes there are problems with this
    A. external Hard Disk - MUST BE - Mac OS Extended (hfs) formatted to be used for VIDEO as KLAUS1 writes.
    B. a FireWire or Thunderbolt one is better than USB/USB2 as they performs badly to me especially when filling up.
    C. DO NEVER - move or alter any folders named
    • iMovie Event's - or -
    • iMovie Project's
    on DeskTop/Finder as this will break the connection to iMovie
    ONLY move Event's and Project's from within iMovie Application !
    D. Then the BIG problem - as I have no answer to - Video and Photos in iPhoto or Aperture.
    Moving them to an external hard disk - and at least MY iMovie can not see them any more - resulting in broken Project's - most probably beyond repair.
    and here I run into the wall of ignorance
    Yours Bengt W

  • How to display sub and sup HTML tags?

    Hallo,
    I use the htmltext property of the text control a lot for displaying Infotext, but this property can not render then <sub> and <sup> Tags. How can I display Infotext where I need, for example, math formulas within the text flow???
    Thanks
    Hans

    Alex,
    Thanks for this information. This framework should meet a lot of my demands, but for this actual project, it's too complex, I only need this 2 tags additional to the existing, and I substituted the <sub> tag by a <font size='-2'> and the <sup> tag by drawing a spezial character (&#8593;). With this drawing of special characters, I can also do a lot.
    But nevertheless that's the framework I need for future projects!
    Thanks
    Hans

  • How to store xml-file direct on file-directory on server ?

    Hello,
    I have created a xml-data by using xmlelements, xmlforest .... and so on in a sql-statement and want to store it as file in a ( windows) server-directory.
    I can find some samples to store it in XML-DB by using dbms_xmlGEN and dbms_XDB,
    but how to store it direct ?
    thank you
    Norbert

    Try dbms_xmldom.writeToFile()..
    Or create a resource from your SQL Statement using dbms_xdb.createResource() and then access the resource via FTP or HTTP

  • How to store xml data fragments, that will not be queried?

    Hello,
    Delphi Client application communicates with Java Server application via XML messages. Client sends XML message over HTTP Post method. Java Servlet gets XML message, parses it, performs requested action (select/insert/update/delete), generates resulting response and sends it back to the Client.
    I use Oracle DB XE 10.2.
    For example: Client sends a request to the server, to append certain Order with new Product info:
    Request:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Request OrderID="123123123" Action="NewProduct">
    - <Product TempProdID="2" ProdName="L01" VisualID="1" Amount="1" TechClass="1" TechSubject="1" TechVersion="0" TechName="TestTech" ElemOk="0">
    <Modified UserID="XXX" UserGroup="XXX" GroupLevel="0" />
    - <QuickInfo>
    <ProdIcon Format="PNG"
    Encoding="Base64">iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAA
    lC+aJAAAAA3RSTlP////6yOLMAAAAvElEQVR42u3aQQ6EIAwAQP7/afe0
    mo1mBVur0emJgwGmRDFNWwvH9I153OpjyoisefqXW3afm4WypP+MgomvT
    z8AAAAAAAAAAAAAAMAzAClzAWQAdvexfqATEKmA/Fm0rYs5ozvoAWyWj4
    ZqJ9efQKR8BJAHOPEdKAAc/lLdAhC/K68EBG+JWwAixfABgF8Jf6MAAAA
    AAAAAAAAAAAAALwRUGgAAAAAAsgGJ3cfVrcfFl2jiIZzV+V7Zd/8BOtNi
    0MnJ58oAAAAASUVORK5CYII=
    </ProdIcon>
    <Parameters />
    </QuickInfo>
    - <TechProduct CurVer="1" MinVer="1" TotalItems="330" ItemNodeSize="55074">
    - <SubItem Class="TPlGraph" BindID="00B9C004">
    <PropList />
    - <SubItem Ident="Profiles" Class="TProfileList" Child="1" BindID="0188598C">
    <PropList />
    - <SubItem Class="TPlProfile" Child="1" BindID="018CA6CC">
    - <PropList>
    <Property PropIdent="ProfBaze0X" ValText="0" />
    <Property PropIdent="ProfBaze0Y" ValText="990" />
    <Property PropIdent="ProfBaze1X" ValText="990" />
    <Property PropIdent="ProfHier0" ValText="0" />
    - <Property PropIdent="InBorder" ValIdent="None" ValText="N&#279;ra">
    <ExtValue ColIdent="ItemCode" Value="None" />
    <ExtValue ColIdent="Type" Value="" />
    <ExtValue ColIdent="Filter" Value="" />
    <ExtValue ColIdent="Width" Value="0" />
    <ExtValue ColIdent="TechCall" Value="" />
    </Property>
    </PropList>
    </SubItem>
    </SubItem>
    </SubItem>
    </TechProduct>
    </Product>
    </Request>
    I use DOM parsers to parse the received requests, extract certain info and insert it into relational tables using standart SQL queries.
    My question is: what is the best way to store XML data fragments, that are not required to be saved relationally? I need to save the content of node <TechProduct> from the above example to relational table's column. There will be no need to query this column, no need to use relational views. I will use it only when Client application will request to modify certain order's product. Then I will have to send back the same <TechProduct> node via XML response.
    So what column type do I have to use? CLOB? XMLType? Is it better to use object types? Do I have to register XML Schema for better performance? The size of the fragment can be ~2MB.
    Thanks for your help
    Message was edited by:
    Kichas

    Thank you for reply,
    As you suggested, I will use XMLType storage as CLOB (without XML Schema).
    As I mentioned before, I use Java Servlet, deployed on Tomcat WebServer, to receive XML messages from Client application via HTTP POST method.
    I use these libs to get the XML payload and parse it into a Document:
    import org.w3c.dom.*;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    And here is the code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try {
    // get the XML payload and parse it into a Document
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document dom;
    InputSource input = new InputSource(request.getInputStream());
    dom = docBuilder.parse(input);
    catch(Exception ex) {
    System.out.println("Exception thrown in XmlService");
    ex.printStackTrace();
    throw new ServletException(ex);
    I create a relational table, that contains XMLType column:
    CREATE TABLE xwarehouses (
    warehouse_id NUMBER,
    warehouse_spec XMLTYPE)
    XMLTYPE warehouse_spec STORE AS CLOB;
    Now I want to insert all DOM Document into XMLType column. So I do like this:
    import oracle.xdb.XMLType;
    String SQLTEXT = "INSERT INTO XWAREHOUSES (WAREHOUSE_ID, WAREHOUSE_SPEC) VALUES (?, ?)";
    XMLType xml = XMLType.createXML(con,dom);
    PreparedStatement sqlStatement = con.prepareStatement(SQLTEXT);
    sqlStatement.setInt(1,2);
    sqlStatement.setObject(2,xml);
    sqlStatement.execute();
    sqlStatement.close();
    dom is the Document, that I got from HTTP Request input stream.
    My servlet throws an exception:
    java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
    at XmlService.GetMatListServiceHandler.processRequest(GetMatListServiceHandler.java:111)
    at XmlService.XmlServiceHandler.handleRequest(XmlServiceHandler.java:43)
    at XmlService.XmlServiceServlet.doPost(XmlServiceServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    why does he needs oracle.xml.parser.v2.XMLParseException? I don't use Oracle parser? Does this code line throws the exception (I am not able to debug my code, because I have not configured JDeveloper to be able to use Remote Debuging):
    XMLType xml = XMLType.createXML(con,dom);
    Does it reparses the given dom Document or what?. When I deploy xmlparserv2.jar to Tomcat, everything is ok, application inserts XML data into XMLType column.
    Is there another way to insert the whole org.w3c.dom Document or Document fragment (that is already parsed) into XMLType column. Can you provide any sample code?
    The Document may contain national symbols, so they should be correctly stored and then later retrieved.
    Many thanks.

  • How to save xml and xsl function to a data grid column

    hi. wondering, i have a xml and a xsl file, and have the transform class, and so need to save the xml and the xsl file, and display the results on a particular data grid column and to loop through the data grid columns. so, how do i use the xml save function
    class, any examples or point me to articles, where i can read how to do this. need to display a file, with a different colour and font. any ideas. thanks. marvin.hi. need to save a xml and xsl file and display the results on data grid. how do i do this. any
    sample code or articles i can read about thanks. marvin.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    
    Hi.
    Okay, well, did ask on the msdn forums, and some one replied, and so, will paste the code he suggested.
    But getting a lot of errors.
    Can you help me out.
    Where am I going wrong.
    So, I can then get this to work, then it shows the colours and the fonts on the specified data grid.
    Can you help.
    Want to get this working and passed today if possible.
    Will pasate the code and the errors below.
    Can you help.
    Where am I going wrong.
    Marvin.
    // Set up the data set.
    DataSet ds =
    new
    DataSet();
    // Set up the data table.
    DataTable dt =
    new
    DataTable();
    // Ad the data table to the data set.
        ds.Tables.Add(dt);
    // Write the xml document to the data grid column.
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
    // Set up the data table and the data set and set to 0.
        dgvDisplayData.DataSource = ds.Tables[0];
    Error      1              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    18           WoodStocks
    Error      2              Invalid token ')' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    21           WoodStocks
    Error      3              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                219        
    16           WoodStocks
    Error      4              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                221        
    16           WoodStocks
    Error      5              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                222        
    15           WoodStocks
    Error      6              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                223        
    15           WoodStocks
    Error      7              Invalid token '=' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    31           WoodStocks
    Error      8              Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    43           WoodStocks
    Error      9              Invalid token ';' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    45           WoodStocks
    Can you help me out.
    Thanks.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

  • How to store XML data into Oracle Table

    I had trouble to store XML data into Oracle Table with XDK (Oracle 8.1.7 ). The error is:
    C:\XDK_Java_9_2\xdk\demo\java\Test>java testInsert Dept.xml
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected.
    Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2263)
    at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1333)
    at testInsert.main(testInsert.java:8)
    Here is my xml file:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>10</DEPTNO>
    <DNAME>ACCOUNTING</DNAME>
    <LOC>NEW YORK</LOC>
    </ROW>
    <ROW num="2">
    <DEPTNO>20</DEPTNO>
    <DNAME>RESEARCH</DNAME>
    <LOC>DALLAS</LOC>
    </ROW>
    <ROW num="3">
    <DEPTNO>30</DEPTNO>
    <DNAME>SALES</DNAME>
    <LOC>CHICAGO</LOC>
    </ROW>
    <ROW num="4">
    <DEPTNO>40</DEPTNO>
    <DNAME>OPERATIONS</DNAME>
    <LOC>BOSTON</LOC>
    </ROW>
    </ROWSET>
    and here is structure of table:
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    and here is my Java Code:
    import java.sql.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert{
         public static void main(String[] args) throws SQLException{
              Connection conn = getConnection();
              OracleXMLSave sav = new OracleXMLSave(conn,"scott.tmp_dept");
              sav.insertXML(args[0]);
              sav.close();
              conn.close();
         private static Connection getConnection()throws SQLException{
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@amt-ebdev01:1521:mydept","scott","tiger");
              return conn;
    Could you help me ? Thanks !

    The problem is that you need to pass avalid URL , Document...
    Please try this code instead:
    import java.net.*;
    import java.sql.*;
    import java.io.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert
    public static void main(String[] args) throws SQLException{
    Connection conn = getConnection();
    OracleXMLSave sav = new OracleXMLSave(conn,"scott.temp_dept");
    URL url = createURL(args[0]);
    sav.insertXML(url);
    sav.close();
    conn.close();
    private static Connection getConnection()throws SQLException{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@dlsun1982:1521:jwxdk9i","scott","tiger");
    return conn;
    // Helper method to create a URL from a file name
    static URL createURL(String fileName)
    URL url = null;
    try
    url = new URL(fileName);
    catch (MalformedURLException ex)
    File f = new File(fileName);
    try
    String path = f.getAbsolutePath();
    // This is a bunch of weird code that is required to
    // make a valid URL on the Windows platform, due
    // to inconsistencies in what getAbsolutePath returns.
    String fs = System.getProperty("file.separator");
    if (fs.length() == 1)
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    url = new URL(path);
    catch (MalformedURLException e)
    System.out.println("Cannot create url for: " + fileName);
    System.exit(0);
    return url;

  • How to store images and video clips in Oracle

    All,
    Can anyone guide me how to store the images and video clips in oracle through pl/sql and also the way to retirve it.
    Edited by: sikander on Sep 7, 2010 3:27 AM

    Some sample code
    connect sys schema  --if scott has no privs to create directory
    --where physical file store in the same machine where database load
    CREATE DIRECTORY IMAGES AS 'D:\images';
    GRANT READ ON DIRECTORY IMAGES TO SCOTT;
    connect scott/tiger
    create table my_book_diagrams (Image BLOB);
    DECLARE
      v_file_loc BFILE;
      v_diagram_loc BLOB;
      v_diagram_size INTEGER;
    BEGIN
      v_file_loc := BFILENAME('IMAGES','Layout.bmp');
      DBMS_LOB.FILEOPEN(v_file_loc );
      v_diagram_size := DBMS_LOB.GETLENGTH(v_file_loc);
      INSERT INTO my_book_diagrams (Image) VALUES (EMPTY_BLOB())
      RETURNING image INTO v_diagram_loc;
      DBMS_LOB.LOADFROMFILE(v_diagram_loc, v_file_loc, v_diagram_size);
    END;
    commit;

  • How to store forms and reports in database

    Hi friends,
    How to store the forms and reports in database?
    when i save a form in database it doesnt prompt with any message
    and when i try to retrieve from the list it prompts me with a
    message
    can anyone suggest me the methods of storing the forms in the
    database and retriving from it.
    Jagadeesh
    null

    I believe this will help you
    To store forms & Reports in Database you need to run some
    scripts which are shipped with Oracle
    To install the SQL scripts:
    Start the Oracle Installer and select Custom Installation or
    Removal from the Oracle Developer Installation Options dialog
    box.
    Select Oracle Developer Database Tables from the Available
    Products list.
    Click Install.
    Installing these scripts creates a Start menu item called Oracle
    Developer R6.0 Admin and the associated submenu items Oracle
    Developer Build, Oracle Developer Drop, Oracle Developer Grant,
    and Oracle Developer Revoke. These menu items, when selected,
    run a script or a series of scripts to perform database
    administration tasks.
    Note: I tried to store forms in the database by creating tables
    but in forms fmb will store in database & fmx will store on
    clients machine so you have to install fmx on all client machines
    I tried to store fmx in database but..................!
    If any body knows how to store FMX in database let me know.
    Rao Guduru
    Jagadeesh (guest) wrote:
    : Hi friends,
    : How to store the forms and reports in database?
    : when i save a form in database it doesnt prompt with any
    message
    : and when i try to retrieve from the list it prompts me with a
    : message
    : can anyone suggest me the methods of storing the forms in the
    : database and retriving from it.
    : Jagadeesh
    null

  • Adobe Reader X and searching within PDFs in Outlook 2007

    Hello,
    Is it possible to search within pdfs attached to emails in Outlook 2007 via the search box in Outlook?  I currently have Adobe Acrobat Reader X installed and Outlook 2007.  Is there an iFilter available for this functionality within Reader X or would I need to either go back to Reader 9 or upgrade to a newer version to have this capability?
    Thanks.

    This may help a few of you here.
    I'm running IE 8 and Adobe Reader X on a WIN64Bit  system.
    Reader X wouldn't open an embedded  PDF with IE8 64BIT. AR X seems to like an older version of IE.
    Go to your START menu and you should see "Internet Explorer" and "Internet Explore (64-bit)".
    Open a window with the "Internet Explorer", not the (64-bit).
    In the IE8 window you'll see a "?" on the tool bar. Open it and click on "About Internet Explorer".
    You should NOT SEE "64-bit Edition".
    If you don't see "64-Bit Edition", go and try to view the PDF again.
    It works for me and it seems I'll have to live with it until there's a patch for 64-Bit.

Maybe you are looking for