Reading xml values in sql server..

Hello All,
                I have a stored procedure which returns an xml. Now, i am writing another database script using this SP.
Now in my script, First i will execute the SP and i am getting the O/P as
<root><person><id>168369</id><fullname>kishopre,ravi</fullname></person><person><id>168374</id><fullname>lasstname12,firstname12</fullname></person></root>
and now i want to get all the id values, may be in some array ,  so that i need to run another query against all the id values
( say select * from P_PERSON where id = id value in xml )
can any 1 please tell me how to grep all the id values in xml and run the query
Thanks...

Hello,
You can use nodes and value methods of the xml data type to return set of IDs:
select idTbl.XmlID.value('(./text())[1]', 'int') from @YourXmlDoc.nodes('/root/person/id') as idTbl(XmlID)
MP.

Similar Messages

  • Bit value in sql-server

    hello frnds,
    i want to insert bit value into sql-server 2000... using hibernate
    what is the datatype for java bean.... ?
    and how it is mappend in mapping xml....?
    if any one has idea then please help me...
    thanx in advance..
    regards
    PanDev84

    The WPF MediaElement (unlike Silverlight's) doesn't support setting the Source to a Stream directly. You could try any of the workarounds suggested here:
    http://stackoverflow.com/questions/7117589/using-mediaelement-to-play-video-from-stream
    Othwerwise you could select the data (bytes) from the database into a byte[]:
    http://stackoverflow.com/questions/13952261/insert-and-retrieve-bytearray-from-sql-server-in-c-sharp
    ...and then save the data to a temporary physical file and play this one as usual:
    byte[] data = ...; //select from db
    System.IO.File.WriteAllBytes("temp.wav", data);
    var mediaPlayer = new MediaPlayer();
    mediaPlayer.Open(new Uri("temp.wav", UriKind.Relative));
    mediaPlayer.Play();
    The MediaPlayer.Open method will read the file via a stream automatically.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • How to Read the Image in SQL server

    I want to read the image from SQL server using labview.In our project languages used are JAVA and Labview
    Through java we acquiring the image and write in to SQL Server.
    Through Labview I want to read the image form SQL server and i will do some image processing for my application.
    My problem when I seen the database the images shown like hex decimal value.
    I want to convert the hexadecimal value to image or any other functions is there to directly read the image from SQL server.
    Can anybody help me....

    two options:
    1. save the image data itself (as a blob)
    2. save the image in a file system and save the file name in the DB

  • Read XML file from presentation server

    Hi All,
    I want read XML file from presentation server currently i am using GUI_UPLOAD fm . but it is reading some junk data.
    DATA : BEGIN OF upl OCCURS 0,
              f(255) TYPE c,
           END OF upl.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename = D:\XX.XML'
          filetype = 'BIN'
        TABLES
          data_tab = upl.
    is there any other alternative.
    Thanks
    Swarup,

    Hi Swarup,
    Use method IMPORT_FROM_FILE of class CL_XML_DOCUMENT.
    A sample code snippet :-
    PARAMETERS: p_filnam TYPE localfile OBLIGATORY
    DEFAULT 'C:\Documents and Settings\ssaha\Desktop\test.xml'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filnam.
    DATA: l_v_fieldname TYPE dynfnam.
    l_v_fieldname = p_filnam.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    field_name = l_v_fieldname
    IMPORTING
    file_name = p_filnam.
    START-OF-SELECTION.
    TYPES:
    BEGIN OF ty_tab,
    name TYPE string,
    value TYPE string,
    END OF ty_tab.
    DATA:
    lcl_xml_doc TYPE REF TO cl_xml_document,
    v_subrc TYPE sysubrc,
    v_node TYPE REF TO if_ixml_node,
    v_child_node TYPE REF TO if_ixml_node,
    v_root TYPE REF TO if_ixml_node,
    v_iterator TYPE REF TO if_ixml_node_iterator,
    v_nodemap TYPE REF TO if_ixml_named_node_map,
    v_count TYPE i,
    v_index TYPE i,
    v_attr TYPE REF TO if_ixml_node,
    v_name TYPE string,
    v_prefix TYPE string,
    v_value TYPE string,
    v_char TYPE char2.
    DATA:
    itab TYPE STANDARD TABLE OF ty_tab,
    wa TYPE ty_tab.
    CREATE OBJECT lcl_xml_doc.
    CALL METHOD lcl_xml_doc->import_from_file
    EXPORTING
    filename = p_filnam
    RECEIVING
    retcode = v_subrc.
    CHECK v_subrc = 0.
    v_node = lcl_xml_doc->m_document.
    CHECK NOT v_node IS INITIAL.
    v_iterator = v_node->create_iterator( ).
    v_node = v_iterator->get_next( ).
    WHILE NOT v_node IS INITIAL.
    CASE v_node->get_type( ).
    WHEN if_ixml_node=>co_node_element.
    v_name = v_node->get_name( ).
    v_nodemap = v_node->get_attributes( ).
    IF NOT v_nodemap IS INITIAL
    * attributes
    v_count = v_nodemap->get_length( ).
    DO v_count TIMES.
    v_index = sy-index - 1.
    v_attr = v_nodemap->get_item( v_index ).
    v_name = v_attr->get_name( ).
    v_prefix = v_attr->get_namespace_prefix( ).
    v_value = v_attr->get_value( ).
    ENDDO.
    ENDIF.
    WHEN if_ixml_node=>co_node_text OR
    if_ixml_node=>co_node_cdata_section.
    * text node
    v_value = v_node->get_value( ).
    MOVE v_value TO v_char.
    IF v_char <> cl_abap_char_utilities=>cr_lf.
    wa-name = v_name.
    wa-value = v_value.
    APPEND wa TO itab.
    CLEAR wa.
    ENDIF.
    ENDCASE.
    * advance to next node
    v_node = v_iterator->get_next( ).
    ENDWHILE.
    LOOP AT itab INTO wa.
    ENDLOOP.
    Regards
    Abhii

  • Ident_Current('TableName') not giving last inserted identity Value in SQL Server 2012

    Hi ,
    Ident_Current('TableName') is not giving last inserted identity Value in SQL Server 2012. 
    Latest Value of ID and Ident_Current is differing for that particular table.  
    Why its happening? Ident_Current value is greater than last inserted ID.
    Please guide me why its happening?

    Here is one example:
    CREATE DATABASE PMCtest ON (NAME = 'PMCtest', FILENAME = 'B:\ProdDB-Unzipped\PMCtest.mdf', SIZE = 25GB )
    LOG ON (NAME = 'PMCtest_log', FILENAME = 'B:\ProdDB-Unzipped\PMCtest.ldf', SIZE = 2GB)
    CREATE TABLE identity_crisis (a int IDENTITY NOT NULL PRIMARY KEY,
                                  b sysname NOT NULL CHECK (b <> 'sysschobjs'))
    go
    INSERT identity_crisis (b) VALUES ('First name')
    INSERT identity_crisis SELECT name FROM sys.objects
    go
    SELECT MAX(a), ident_current('identity_crisis')
    FROM  identity_crisis
    go
    DROP TABLE identity_crisis
    Because the second INSERT statement fails, the identity values from 2 to 12 are lost. This is a very intentional design to promote high concurrency. If you don't want gaps, you should not use IDENTITY, but roll your own.
    Also, beware that ident_current returns database-wide value, so if you insert one row, and another process inserts another row before you interrogate ident_current, you will get the id for the row of the other process.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • FM to read XML files from Application server in ECC5.0

    Hi All,
    We need to pick up an XML file from Application server/FTP server. The requirement is to parse the XML file and process it to create material master. SAP provides standard function modules to read XML files.
    Now we need to read the XML file contents of MM01 and upload into SAP Data Base through BAPI
    I need to know about the Function modules to read XML files from Application Server and also about the FM's that will update the Date base tables with the data obtained form XML files.
    Regards
    Prathima

    Parsing XML data:
    http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
    or alternatively check out ABAP online help for "CALL TRANSFORMATION".
    For creating the material master look at BAPI_STANDARDMATERIAL_CREATE.
    Thomas

  • Reading XML file from application server and  put into internal table-4.6C

    Dear All,
    Is there any way of reading XML file from application server to SAP? I am using 4.6C. Function module SCMS_STRING_TO_XSTRING function module is not available. Please suggest.
    Thanks and regards,
    Atanu

    Hi Atanu!
    Simply use the XSLT transformation 'ID'.
    FIELD-SYMBOLS <ls_result> TYPE ANY.
    CREATE DATA lref_data TYPE (your_structure).
    ASSIGN lref_data->* TO <ls_result>.
    CALL TRANSFORMATION id
                        SOURCE XML xmlstr
                        RESULT result = <ls_result>.
    "xmlstr" contains your XML file. Just read it into it via standard I/O operations. "<ls_result>" will contain your DDIC formatted content.
    Best regards
    Torsten

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • I want to give a user to read only rights on sql server agent 2008

    I want to give a user to read only rights on sql server agent 2008.When I giving SQLAgentuser Role then user is only able to view SQL Server agent as Green but no job visible in job activity monitor.Currently he has db_reader rights on one user database.
    What rights should I give?
    Thanks

    There are 3 SQL server Agent fixed database roles in sql server.
    1.SQL AgentUSerRole:- To create and manage jobs
    2.SQLAgentReaderRole: To grant read acces.
    3.SQLAgentOperatorRole : to run and delete jobs.
    For you question you can create a user and grant him SQLAgentReaderRole.
    Example:
    Create LOGIN test with Password='abc'
    Use msdb;
    GO
    Create User test for login test
    use msdb;
    EXECUTE sp_addrolemember @rolename='SQLAgentReaderRole',@membername='test'
    Hope this solves your problem!!!

  • Read Money format from SQL Server 2008

    Hi all,
    i created a db link from oracle to sql server using Heterogeneous Connectivity, it works fine, i can read/write data from SQL Server 2008 but i can't read column with money format correctly, i got always a integer number.
    Can anyone help me, please?
    Sergio

    Hi Mark,
    with the command
    describe TEST@DL_SQLSERVER2008
    i get the error :
    Error: ORA-00904: "OBJECT_TYPE": invalid identifier
    If i create a table :
    CREATE TABLE TEMP AS (SELECT * FROM TEST@DL_SQLSERVER2008 );
    the column of the table TEST with type MONEY is mapped to the type number(19,4)
    With the query from SQL Server the output is :
    Entita Serie     Articolo     Prezzo
    1     AB      0207405      3,822
    1     AB      0503019      3,60
    1     AB      0509015      15,75
    1     AB      0706015      1,96
    1     AB      0810050      1,617
    1     AB      STANDARD 0,00
    With the query from Oracle the output is :
    Entita Serie     Articolo     Prezzo
    1     AB      0207405      3
    1     AB      0503019      3
    1     AB      0509015      15
    1     AB      0706015      1
    1     AB      0810050      1
    1     AB      STANDARD 0
    Thanks,
    Sergio

  • Function module to read xml files from application server

    Hi experts,
            I need to read  xml files from application server to sap. Is the any siutable function moldule for that?

    Hi Cenosure,
    Donno about FM which will upload data directly to SAP, I think you have to do some mapping for it so that it will suit the SAP format. Again it depends on your requirement..
    Please elaborate more about your requirement.
    Please have a look on below FM
    TEXT_CONVERT_XML_TO_SAP
    Also search on SCN there are many threads on the same topic available.
    http://abapreports.blogspot.com/2008/09/upload-xml-file-from-application-server.html
    This is the link which will give you the Code
    http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XML_TO_ABAP_46C.html
    Use this XML file to Upload the same, this Program will work for your XML file also,
    http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/input_xml.xml
    See the below thread also
    Upload XML to internal table and vice versa in SAP 4.6C
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • XML Schema Collection (SQL Server 2012): How to create an XML Schema Collection that can be used to Validate a field name (column title) of an existing dbo Table of a Database in SSMS2012?

    Hi all,
    I used the following code to create a new Database (ScottChangDB) and a new Table (marvel) in my SQL Server 2012 Management Studio (SSMS2012) successfully:
    -- ScottChangDB.sql saved in C://Documents/SQL Server XQuery_MacLochlainns Weblog_code
    -- 14 April 2015 09:15 AM
    USE master
    IF EXISTS
    (SELECT 1
    FROM sys.databases
    WHERE name = 'ScottChangDB')
    DROP DATABASE ScottChangDB
    GO
    CREATE DATABASE ScottChangDB
    GO
    USE ScottChangDB
    CREATE TABLE [dbo].[marvel] (
    [avenger_name] [char] (30) NULL, [ID] INT NULL)
    INSERT INTO marvel
    (avenger_name,ID)
    VALUES
    ('Hulk', 1),
    ('Iron Man', 2),
    ('Black Widow', 3),
    ('Thor', 4),
    ('Captain America', 5),
    ('Hawkeye', 6),
    ('Winter Soldier', 7),
    ('Iron Patriot', 8);
    SELECT avenger_name FROM marvel ORDER BY ID For XML PATH('')
    DECLARE @x XML
    SELECT @x=(SELECT avenger_name FROM marvel ORDER BY ID FOR XML PATH('Marvel'))--,ROOT('root'))
    SELECT
    person.value('Marvel[4]', 'varchar(100)') AS NAME
    FROM @x.nodes('.') AS Tbl(person)
    ORDER BY NAME DESC
    --Or if you want the completed element
    SELECT @x.query('/Marvel[4]/avenger_name')
    DROP TABLE [marvel]
    Now I am trying to create my first XML Schema Collection to do the Validation on the Field Name (Column Title) of the "marvel" Table. I have studied Chapter 4 XML SCHEMA COLLECTIONS of the book "Pro SQL Server 2008 XML" written by
    Michael Coles (published by Apress) and some beginning pages of XQuery Language Reference, SQL Server 2012 Books ONline (published by Microsoft). I mimicked  Coles' Listing 04-05 and I wanted to execute the following first-drafted sql in
    my SSMS2012:
    -- Reference [Scott Chang modified Listing04-05.sql of Pro SQL Server 2008 XML by Michael Coles (Apress)]
    -- [shcColes04-05.sql saved in C:\\Documents\XML_SQL_Server2008_code_Coles_Apress]
    -- [executed: 2 April 2015 15:04 PM]
    -- shcXMLschemaTableValidate1.sql in ScottChangDB of SQL Server 2012 Management Studio (SSMS2012)
    -- saved in C:\Documents\XQuery-SQLServer2012
    tried to run: 15 April 2015 ??? AM
    USE ScottChangDB;
    GO
    CREATE XML SCHEMA COLLECTION dbo. ComplexTestSchemaCollection_all
    AS
    N'<?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="marvel">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="avenger_name" />
    <xsd:element name="ID" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>';
    GO
    DECLARE @x XML (dbo. ComplexTestSchemaCollection_all);
    SET @x = N'<?xml version="1.0"?>
    <marvel>
    <avenger_name>Thor</name>
    <ID>4</ID>
    </marvel>';
    SELECT @x;
    GO
    DROP XML SCHEMA COLLECTION dbo.ComplexTestSchemaCollection_all;
    GO
    I feel that drafted sql is very shaky and it needs the SQL Server XML experts to modify to make it work for me. Please kindly help, exam the coding of my shcXMLTableValidate1.sql and modify it to work.
    Thanks in advance,
    Scott Chang

    Hi Scott,
    2) Yes, FOR XML PATH clause converts relational data to XML format with a specific structure for the "marvel" Table. Regarding validate all the avenger_names, please see below
    sample.
    DECLARE @x XML
    SELECT @x=(SELECT ID ,avenger_name FROM marvel FOR XML PATH('Marvel'))
    SELECT @x
    SELECT
    n.value('avenger_name[1]','VARCHAR(99)') avenger_name,
    n.value('ID[1]','INT') ID
    FROM @x.nodes('//Marvel') Tab(n)
    WHERE n.value('ID[1]','INT') = 1 -- specify the ID here
    --FOR XML PATH('Marvel')  --uncommented this line if you want the result as element type
    3)i.check the xml schema content
    --find xml schema collection
    SELECT ss.name,xsc.name collection_name FROM sys.xml_schema_collections xsc JOIN sys.schemas ss ON xsc.schema_id= ss.schema_id
    select * from sys.schemas
    --check the schema content,use the name,collection_name from the above query
    SELECT xml_schema_namespace(N'name',N'collection_name')
    3)ii. View can be viewed as virtual table. Use a view to list the XML schema content.
    CREATE VIEW XSDContentView
    AS
    SELECT ss.name,xsc.name collection_name,cat.content
    FROM sys.xml_schema_collections xsc JOIN sys.schemas ss ON xsc.schema_id= ss.schema_id
    CROSS APPLY(
    SELECT xml_schema_namespace(ss.name,xsc.name) AS content
    ) AS cat
    WHERE xsc.name<>'sys'
    GO
    SELECT * FROM XSDContentView
    By the way, it would be appreciated if you can spread your questions into posts. For any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Reading XML File from application server

    Hi experts,
    My aim is to read a XML file from application server and extract the relevant data from it and process further.
    When I am trying to read a XML file from application server it is reading success fully but the problem is that its not reading the last root structure of XML file why is so happening can any body help me?
    I am using the following code:
    TYPES: BEGIN OF xml_line,
    text(256) type x,
    END OF xml_line.
    DATA: e_file LIKE rlgrap-filename VALUE  'applcatin server path'
    OPEN DATASET e_file FOR INPUT IN BINARY MODE.
    IF sy-subrc EQ 0.
      DO.
        READ DATASET e_file INTO wa_item1-text.
        IF sy-subrc EQ 0.
          APPEND wa_item1 TO gt_item1 .
          CLEAR wa_item1.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ENDIF.
    CLOSE DATASET e_file.
    after this i am passing this internal table to "cl_ixml" class to extract the data
    but it returning the itab with required value except the last record.
    The stream reading the file it self is i thought in complete thats why it is not converting the all values.
    Please  help me...
    Thanks a ton in advance.

    Hi,
    1 Copy Report BCCIIXMLT1
    2 (you can change the way of filling internal table xml_table if necessary)
    3 you don't need the part between
    *-- render the DOM back into an output stream/internal table
    and
    *-- print the whole DOM tree as a list...
    Comment it out or simply delete it
    4 Rename form print_node to your liking e.g. process_node
    5 In your new form you need three extra variables:
    data: attribs type ref to IF_IXML_NAMED_NODE_MAP,
          attrib_node type ref to IF_IXML_NODE,
          attrib_value type string.
    6 After the lines:
    when if_ixml_node=>co_node_element.
      string = pNode->get_name( ).
    Insert:
    attribs = pNode->get_attributes( ).
    clear attrib_value.
    case string.
      when ''. "put your XML tag name here
        attrib_node = attribs->get_named_item(name = '' ). "put your XML attribute name here
        attrib_value = attrib_node->get_value( ).
    You can also refer link,
    /people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach
    thanks & regards
    shreemohan

  • Read XML file from different server on JSP

    Dear All,
    I am a newbie to JSP with XML, now i want to read the "test.xml" from JSP.
    I read successfully this "test.xml" file from my system and I got output, but I need to read the xml file from
    different server like "http://www.domain.com/test.xml". I couldn't read such a type of file from different server.
    Is it possible to read a xml file from different server?
    If anybody have idea please let me know.
    Thanks in Advance,
    Prasath.
    <%@ page import="java.sql.*,java.io.*,java.util.*,javax.xml.parsers.*,org.w3c.dom.*,org.xml.sax.*" %>
    <%
    try {
        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
        Document doc = docBuilder.parse (new File("http://www.domain.com/test.xml"));
        // normalize text representation
        doc.getDocumentElement ().normalize ();
        out.println ("Root element of the doc is " +
             doc.getDocumentElement().getNodeName()+"<br>");
        NodeList listOfPersons = doc.getElementsByTagName("person");
        int totalPersons = listOfPersons.getLength();
        out.println("Total no of people : " + totalPersons+"<br>");
        for(int s=0; s<listOfPersons.getLength() ; s++){
            Node firstPersonNode = listOfPersons.item(s);
            if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
                Element firstPersonElement = (Element)firstPersonNode;
                NodeList firstNameList = firstPersonElement.getElementsByTagName("first");
                Element firstNameElement = (Element)firstNameList.item(0);
                NodeList textFNList = firstNameElement.getChildNodes();
                out.println("First Name : " +
                       ((Node)textFNList.item(0)).getNodeValue().trim()+"<br>");
                NodeList lastNameList = firstPersonElement.getElementsByTagName("last");
                Element lastNameElement = (Element)lastNameList.item(0);
                NodeList textLNList = lastNameElement.getChildNodes();
                out.println("Last Name : " +
                       ((Node)textLNList.item(0)).getNodeValue().trim()+"<br>");
                NodeList ageList = firstPersonElement.getElementsByTagName("age");
                Element ageElement = (Element)ageList.item(0);
                NodeList textAgeList = ageElement.getChildNodes();
                out.println("Age : " +
                       ((Node)textAgeList.item(0)).getNodeValue().trim()+"<br>");
            }//end of if clause
        }//end of for loop with s var
    }catch (SAXParseException err) {
    out.println ("** Parsing error" + ", line "
         + err.getLineNumber () + ", uri " + err.getSystemId ());
    out.println(" " + err.getMessage ());
    }catch (SAXException e) {
    Exception x = e.getException ();
    ((x == null) ? e : x).printStackTrace ();
    }catch (Throwable t) {
    t.printStackTrace ();
    %>

    You might try:
    Document doc = docBuilder.parse ("http://www.domain.com/test.xml");Alternatively use the java.net package to obtain an Input Stream to the xml document
    InputStream in = methodThatYouWriteYourselfCalledgetInputStreamForURI("http://www.domain.com/test.xml");
    Document doc = docBuilder.parse (in);cheers,
    evnafets

  • Storing 6 millions values in SQL server columns

    Hi,
    How many values (size) I can store in single SQL server column.
    My Scenario,
    Column1    Column2      Column3
         1      ABC     1,2,3,........(6 millions values)  
         2      CDE     1,2,3,.......(6 millions values)  
    and problem is that I can't store them in rows. I need to store them in single column with comma separated.
    What would be the best way to store them and retrieve them faster. I am thinking about converting it to byte[] or something but not sure how much time it will take to convert to byte and  then again to text.

    and problem is that I can't store them in rows. I need to store them in single column with comma separated.
    No you don't! Unless, that is, you really like to hurt yourself. It's a basic idea that in a relational database that each cell holds an atomic value, and this what relational datbases are optimised for.
    That said, if all you want to do is to store a bunch of values that you will never look at in the database, but the database will act as an unintelligent data store you will only look at the values outside the database, then it
    could make sense. However, a warning: just because you think that there is no requirement today, don't be surprised that you are sooner or later are asked questions like: "which the highest value for ABC?", "Which value is the most
    frequent across ABCs and CDEs?". Questions that are very simple to answer is you have data in a properly designed data model. But extremely to painful to answer if your all values in a single column.
    But if you take this, path, yes, storing values in a varbinary(MAX) with four bytes (or whatever that is needed) per value would be the best thing. It takes up less space than a string, and with fixed length it's easier to find value 198713 if this would
    be nedded. You seem to be worried about conversion from byte to text. Why is not clear to me, since number are usally born binary. But obviously, I have no idea where you get these values from or how you would use them.
    My initial recommendation still stands: store each value in a single row.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Time Machine loses place

    This is frustrating!!! Time Machine has lost its place three times. It can't find the backup disk. The only way to reconnect that I can find is to then choose "Change Disk". I then select the disk it could not find and Time Machine ignores the previo

  • Oracle: slow performance with SELECT using ojdbc14 and connection pooling

    Hello, i'm working hard the last days to solve a performance problem with our customer using a oracle 10g database. For testing I used our oracle 9.2.0.1.0 database which shows the same symptoms. All doing solved nothing: the performance while using

  • SSO Error in SRM Portal

    Hi All, We are on SRM 7.0 and we use the portal instance delivered with SRM JAVA. I am setting up the portal instance and used the following links for the same. /people/sap.user72/blog/2004/09/15/quick-guide-for-setting-up-sso-between-ep-and-r3 /peop

  • Updating Photoshop Elements 12

    I'm running Photoshop Elements 12 on a MacBook Pro and OS-X 10.9.5 and when I try to update Photoshop Elements 12 to 12.1, I get the following messages. Adobe Photoshop Elements 12.1 Update Installation failed. Error Code: U44M1P7 Adobe Premiere Elem

  • Problems with borderless printing with iPhoto '08 and HP Photosmart Printer

    I am trying to print borderless 4x6 photos on HP Photosmart C6250 (same as all HP C62xx Photosmart printers). I am using the HP 4x6 photo paper with the perforated tab. When I select the paper size, I specify Borderless 4x6 in/10 x15 cm (tab). Accord