Oracle equivalent of "for xml auto, elements"

Apologies if this is a bit of a "newbie" question.
I have a .NET application that makes extensive use of the SQL Server syntax "for xml auto, elements" to retrieve data as an XML stream and then merge this with XSL to produce reports.
I would like to support both Oracle and SQL Server. Is there a simple way to do this without writing an Oracle specific interface and rewriting all my SQL?

Hello.
I am struggling with this, so here are some examples:
MS SQL Server will allow "for XML auto, elements" or "for XML raw" to be added to the end of a SQL statement to return an XML stream instead of a data set. Taking the MS example Northwind database, the query:
"select CompanyName, ContactName from Customers where CustomerId like 'A%' for XML raw"
would return the following stream:
<row CompanyName="Alfreds Futterkiste" ContactName="Maria Anders"/>
<row CompanyName="Ana Trujillo Emparedados y helados" ContactName="Ana Trujillo"/>
<row CompanyName="Antonio Moreno Taquer&#237;a" ContactName="Antonio Moreno"/>
<row CompanyName="Around the Horn" ContactName="Thomas Hardy"/>
If you were to change the SQL to be:
"select CompanyName, ContactName from Customers where CustomerId like 'A%' for XML auto, elements"
...you would get back:
<Customers><CompanyName>Alfreds Futterkiste</CompanyName><ContactName>Maria Anders</ContactName></Customers><Customers><CompanyName>Ana Trujillo Emparedados y helados</CompanyName><ContactName>Ana Trujillo</ContactName></Customers><Customers><CompanyName>Antonio Moreno Taquer&#237;a</CompanyName><ContactName>Antonio Moreno</ContactName></Customers><Customers><CompanyName>Around the Horn</CompanyName><ContactName>Thomas Hardy</ContactName></Customers>
I have found this useful when merging with XSL to create reports and/or pages on the fly based on queries. I have recently joined OPN and am looking to migrate my applications to Oracle and this is a key factor for me.
All help gratefully received.

Similar Messages

  • What sql will be for oracle for FOR XML AUTO, XMLSCHEMA, ELEMENTS XSINIL

    Hi all,
    I have developed an application which supports both database sql server and oracle. I am using sql
    select * from test FOR XML AUTO, XMLSCHEMA, ELEMENTS XSINIL, ROOT('test')
    to fetch records in xml format from SQL Server.
    I want to know what sql will be for oracle to get same result set in xml format.
    Thanks in advance.
    Edisphere software
    Vijay singh

    here is one way...
    declare
      qryctx         DBMS_XMLquery.ctxType;
      v_message CLOB;
      v_sql          VARCHAR2(400);
    begin  v_sql  := 'SELECT * FROM DUAL';
      qryctx := DBMS_XMLquery.newContext(v_sql);
      v_message :=  DBMS_XMLquery.getXML(qryCtx);
      DBMS_XMLquery.closeContext(qryCtx);
    dbms_output.put_line(v_message);
    end;
    Sample  output is:
    ===========
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>Validate it against a schema
    xmldoc XMLTYPE;
    v_xml_schema varchar2(4000) :='your schema definition';
      xmldoc := XMLTYPE(v_xml).createSchemaBasedXML(v_xml_schema);
      xmldoc.schemaValidate();Edited by: user130038 on Sep 20, 2011 6:00 AM

  • No method found for XML query element

    Hi,
    I have an EJB module which contains some entity beans.
    If I try to deploy it or verify it using the Sun One Verifier Tool I get the following exception...
    Error: ** Error trying to process file: java.lang.RuntimeException: No method found for XML query element: Ambiguous or invalid <query-method>
    java.lang.RuntimeException: No method found for XML query element: Ambiguous or invalid <query-method>
    at com.sun.enterprise.deployment.xml.EjbNode.parseQueries(EjbNode.java:700)
    at com.sun.enterprise.deployment.xml.EjbNode.completeLoadingDescriptor(EjbNode.java:671)
    at com.sun.enterprise.deployment.xml.EjbBundleNode.completeLoadingDescriptor(EjbBundleNode.java:524)
    at com.iplanet.ias.deployment.EjbBundleXmlReader.load(EjbBundleXmlReader.java:249)
    at com.iplanet.ias.deployment.EjbBundleXmlReader.loadStdAloneModule(EjbBundleXmlReader.java:162)
    at com.sun.enterprise.tools.verifier.Verifier.openEjbJar(Verifier.java:2421)
    at com.sun.enterprise.tools.verifier.Verifier.loadEjbJar(Verifier.java:1318)
    at com.sun.enterprise.tools.verifier.Verifier.loadJar(Verifier.java:866)
    at com.sun.enterprise.tools.verifier.gui.MainPanel.run(MainPanel.java:187)
    at java.lang.Thread.run(Thread.java:536)
    Look in file "EntityBeans.jar_verified.xml" for detailed results on test assertions.
    This problem can be resolved by un-installing the IDE, removing my user directory, and re-installing the IDE (I am using SunOne Studio 5 SE Update 1). The problem is that it returns with alarming regularity.
    Anyone else experiencing this? Any help would be much appreciated.

    Sometimes, but not always, this exception appears in the ide.log before the error first occurs.
    com.sun.forte4j.j2ee.packaging.PackagingIOException: package/EntityBeans.ejbjar
         at com.sun.forte4j.j2ee.packaging.PackagingUtil.writeJarFile(PackagingUtil.java:403)
         at com.sun.forte4j.j2ee.packaging.PackagingUtil.writeJarFile(PackagingUtil.java:67)
         at com.sun.forte4j.j2ee.ejbmodule.EJBModuleDataObject.writeEJBJar(EJBModuleDataObject.java:2673)
         at com.iplanet.ias.tools.forte.verifier.VerifierAction.performAction(VerifierAction.java:63)
         at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:431)
         at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:97)
         at org.openide.util.Task.run(Task.java:136)
         at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:670)

  • XML output from oracle equivalent to sql server

    Hi,
    I need an equivalent sql server 2005 equivalent output from oracle.
    Tried with DBMS_XMLGEN.getxml, xforest etc. But I am not able to get desired output.
    Could anyone help me in giving a hint to do so.
    Here below i am pasting sql server 2005 query and output, oracle query and output.
    SELECT top 5
    P.process_id AS Ppid,
    P.name AS Pn,
    P.group_id AS Pg,
    P.locked AS Pl,
    P.build AS Pb,
    100 AS qcount,
    200 AS ocount,
    PI.question_id AS PIqid,
    PI.process_id AS PIpid,
    PI.posx AS PIpx,
    PI.posy AS PIpy,
    PI.innertext AS PItext,
    PI.itemtype AS PItype,
    PI.linkfrom AS PIfrom,
    PI.linkto AS PIto,
    PI.associated AS PIas,
    PI.content_id AS PIc,
    PI.exitpoint1_id AS PIe1,
    PI.exitpoint2_id AS PIe2,
    PI.exitpoint3_id AS PIe3,
    PI.resolveidentifier AS PIri,
    PI.libquestion_idfk AS PIlqid,
    PI.followoncall AS PIfoc,
    PI.userinput AS PIui,
    PI.isLocked AS PIstls,
    PI.PreviousAnswer as PIPAns,
    PI.VisibleToAgent as PIVAgent,
    PI.RetryAttempt as PIRetry,
    PI.Tags as PITag,
    PO.option_id AS POoid,
    PO.question_id AS POqid,
    PO.process_id AS popid,
    PO.posx AS POpx,
    PO.posy AS POpy,
    PO.opt_innertext AS POtext,
    PO.opt_linkfrom AS POfrom,
    PO.opt_linkto AS POto,
    PO.libquestion_idfk AS POlqid,
    PO.liboption_idfk AS POloid
    FROM
    dbo.processes_ec AS P WITH (nolock) INNER JOIN
    dbo.vw_ProcessesQuestions_Simulator_v6 AS PI WITH (nolock)
    ON P.process_id = PI.process_id LEFT OUTER JOIN
    dbo.vw_ProcessesOptions_Simulator_v6 AS PO WITH (nolock)
    ON PI.question_id = PO.question_id AND PI.process_id = PO.process_id
    ORDER BY Ppid, PIqid, POoid ASC
    FOR XML AUTO, ELEMENTS
    O/P
    <P>
    <Ppid>450</Ppid>
    <Pn>CBB1015 - Router Firewall Settinngs Process</Pn>
    <Pg>9</Pg>
    <Pl>0</Pl>
    <Pb>5</Pb>
    <qcount>100</qcount>
    <ocount>200</ocount>
    <PI>
    <PIqid>1</PIqid>
    <PIpid>450</PIpid>
    <PIpx>366</PIpx>
    <PIpy>-516</PIpy>
    <PItext>CBB1015 - Router Firewall Settinngs Process</PItext>
    <PItype>Title</PItype>
    <PIto>2</PIto>
    <PO />
    </PI>
    <PI>
    <PIqid>2</PIqid>
    <PIpid>450</PIpid>
    <PIpx>366</PIpx>
    <PIpy>-437</PIpy>
    <PItext>Is the customers PC Firewall turned off?</PItext>
    <PItype>Question</PItype>
    <PIfrom>1</PIfrom>
    <PIto>2.2,2.1</PIto>
    <PO>
    <POoid>1</POoid>
    <POqid>2</POqid>
    <popid>450</popid>
    <POpx>-50</POpx>
    <POpy>70</POpy>
    <POtext>Yes</POtext>
    <POto>5</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>2</POqid>
    <popid>450</popid>
    <POpx>50</POpx>
    <POpy>70</POpy>
    <POtext>No</POtext>
    <POto>3</POto>
    </PO>
    </PI>
    <PI>
    <PIqid>3</PIqid>
    <PIpid>450</PIpid>
    <PIpx>468</PIpx>
    <PIpy>-344</PIpy>
    <PItext>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PItext>
    <PItype>Question</PItype>
    <PIfrom>2.2</PIfrom>
    <PIto>3.2,3.1</PIto>
    <PIc>278</PIc>
    <PO>
    <POoid>1</POoid>
    <POqid>3</POqid>
    <popid>450</popid>
    <POpx>-50</POpx>
    <POpy>70</POpy>
    <POtext>Yes</POtext>
    <POto>5</POto>
    </PO>
    <PO>
    <POoid>2</POoid>
    <POqid>3</POqid>
    <popid>450</popid>
    <POpx>50</POpx>
    <POpy>70</POpy>
    <POtext>No</POtext>
    <POto>4</POto>
    </PO>
    </PI>
    </P>
    Oracle query and output
    select DBMS_XMLGEN.getxml('select * from (SELECT
    P.process_id AS Ppid,
    P.name AS Pn,
    P.group_id AS Pg,
    P.locked AS Pl,
    P.build AS Pb,
    100 AS qcount,
    200 AS ocount,
    PI.question_id AS PIqid,
    PI.process_id AS PIpid,
    PI.posx AS PIpx,
    PI.posy AS PIpy,
    PI.innertext AS PItext,
    PI.itemtype AS PItype,
    PI.linkfrom AS PIfrom,
    PI.linkto AS PIto,
    PI.associated AS PIas,
    PI.content_id AS PIc,
    PI.exitpoint1_id AS PIe1,
    PI.exitpoint2_id AS PIe2,
    PI.exitpoint3_id AS PIe3,
    PI.resolveidentifier AS PIri,
    PI.libquestion_idfk AS PIlqid,
    PI.followoncall AS PIfoc,
    PI.userinput AS PIui,
    PI.isLocked AS PIstls,
    PI.PreviousAnswer as PIPAns,
    PI.VisibleToAgent as PIVAgent,
    PI.RetryAttempt as PIRetry,
    PI.Tags as PITag,
    PO.option_id AS POoid,
    PO.question_id AS POqid,
    PO.process_id AS popid,
    PO.posx AS POpx,
    PO.posy AS POpy,
    PO.opt_innertext AS POtext,
    PO.opt_linkfrom AS POfrom,
    PO.opt_linkto AS POto,
    PO.libquestion_idfk AS POlqid,
    PO.liboption_idfk AS POloid
    FROM
    processes_ec P INNER JOIN
    vw_ProcessesQuestions_Sim_v6 PI
    ON P.process_id = PI.process_id LEFT OUTER JOIN
    vw_ProcessesOptions_Sim_v6 PO
    ON PI.question_id = PO.question_id AND PI.process_id = PO.process_id
    ORDER BY Ppid, PIqid, POoid ASC) where rownum<=5') from dual
    O/P
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <PPID>450</PPID>
    <PN>CBB1015 - Router Firewall Settinngs Process</PN>
    <PG>9</PG>
    <PL>0</PL>
    <PB>5</PB>
    <QCOUNT>100</QCOUNT>
    <OCOUNT>200</OCOUNT>
    <PIQID>1</PIQID>
    <PIPID>450</PIPID>
    <PIPX>366</PIPX>
    <PIPY>-516</PIPY>
    <PITEXT>CBB1015 - Router Firewall Settinngs Process</PITEXT>
    <PITYPE>Title</PITYPE>
    <PITO>2</PITO>
    </ROW>
    <ROW>
    <PPID>450</PPID>
    <PN>CBB1015 - Router Firewall Settinngs Process</PN>
    <PG>9</PG>
    <PL>0</PL>
    <PB>5</PB>
    <QCOUNT>100</QCOUNT>
    <OCOUNT>200</OCOUNT>
    <PIQID>2</PIQID>
    <PIPID>450</PIPID>
    <PIPX>366</PIPX>
    <PIPY>-437</PIPY>
    <PITEXT>Is the customers PC Firewall turned off?</PITEXT>
    <PITYPE>Question</PITYPE>
    <PIFROM>1</PIFROM>
    <PITO>2.2,2.1</PITO>
    <POOID>1</POOID>
    <POQID>2</POQID>
    <POPID>450</POPID>
    <POPX>-50</POPX>
    <POPY>70</POPY>
    <POTEXT>Yes</POTEXT>
    <POTO>5</POTO>
    </ROW>
    <ROW>
    <PPID>450</PPID>
    <PN>CBB1015 - Router Firewall Settinngs Process</PN>
    <PG>9</PG>
    <PL>0</PL>
    <PB>5</PB>
    <QCOUNT>100</QCOUNT>
    <OCOUNT>200</OCOUNT>
    <PIQID>2</PIQID>
    <PIPID>450</PIPID>
    <PIPX>366</PIPX>
    <PIPY>-437</PIPY>
    <PITEXT>Is the customers PC Firewall turned off?</PITEXT>
    <PITYPE>Question</PITYPE>
    <PIFROM>1</PIFROM>
    <PITO>2.2,2.1</PITO>
    <POOID>2</POOID>
    <POQID>2</POQID>
    <POPID>450</POPID>
    <POPX>50</POPX>
    <POPY>70</POPY>
    <POTEXT>No</POTEXT>
    <POTO>3</POTO>
    </ROW>
    <ROW>
    <PPID>450</PPID>
    <PN>CBB1015 - Router Firewall Settinngs Process</PN>
    <PG>9</PG>
    <PL>0</PL>
    <PB>5</PB>
    <QCOUNT>100</QCOUNT>
    <OCOUNT>200</OCOUNT>
    <PIQID>3</PIQID>
    <PIPID>450</PIPID>
    <PIPX>468</PIPX>
    <PIPY>-344</PIPY>
    <PITEXT>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PITEXT>
    <PITYPE>Question</PITYPE>
    <PIFROM>2.2</PIFROM>
    <PITO>3.2,3.1</PITO>
    <PIC>278</PIC>
    <POOID>1</POOID>
    <POQID>3</POQID>
    <POPID>450</POPID>
    <POPX>-50</POPX>
    <POPY>70</POPY>
    <POTEXT>Yes</POTEXT>
    <POTO>5</POTO>
    </ROW>
    <ROW>
    <PPID>450</PPID>
    <PN>CBB1015 - Router Firewall Settinngs Process</PN>
    <PG>9</PG>
    <PL>0</PL>
    <PB>5</PB>
    <QCOUNT>100</QCOUNT>
    <OCOUNT>200</OCOUNT>
    <PIQID>3</PIQID>
    <PIPID>450</PIPID>
    <PIPX>468</PIPX>
    <PIPY>-344</PIPY>
    <PITEXT>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PITEXT>
    <PITYPE>Question</PITYPE>
    <PIFROM>2.2</PIFROM>
    <PITO>3.2,3.1</PITO>
    <PIC>278</PIC>
    <POOID>2</POOID>
    <POQID>3</POQID>
    <POPID>450</POPID>
    <POPX>50</POPX>
    <POPY>70</POPY>
    <POTEXT>No</POTEXT>
    <POTO>4</POTO>
    </ROW>
    </ROWSET>
    Any help really appreciated.
    Thanks in advance

    Here are the links ->
    http://www.psoug.org/reference/xml_functions.html
    http://www.psoug.org/reference/dbms_xmlgen.html
    http://www.adp-gmbh.ch/ora/sql/xmlelement.html
    http://www.oracle-base.com/articles/9i/SQLXML9i.php
    http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96620/toc.htm
    Regards.
    Satyaki De

  • Single detail Record repeated with xml for in wcf sql for xml polling.

    Hi,
    I am getting a weird results for a inner join of header detail with for xml auto, element.
    If I run the query in sql it gives me master detail results as expected. i.e
    <HEADER>
    <ID>1</ID>
           <DETAIL><ID>1</ID></DETAIL>
         <DETAIL><ID>2</ID></DETAIL>
    </HEADER>
    In BizTalk I configured the receive location and added a root node and the namespace to the binding properties.
    I get results as.
    <HEADER>
    <ID>1</ID>
           <DETAIL><ID>1</ID></DETAIL>
    </HEADER>
    <HEADER>
    <ID>1</ID>
           <DETAIL><ID>2</ID></DETAIL>
    </HEADER>
    Please Advice.
    Thank you and have great day! Vivek Kulkarni MCAD.net

    Hi Vivek,
    Took a while to simulate your issue. The usage of "FOR XML AUTO, ELEMENTS" is generally used in the old SQL-adapter. To get this working in the WCF-SQL adapter, you need to have some properties set which is not explored well.
    The issue is due to the way you have defined the SQL query and the "InboundOperationType" property of the WCF-SQL adapter. Here is the steps I have done to get the result as you wanted in WCF-SQL adapter, the same output as "FOR XML AUTO,
    ELEMENTS " in SQL.
    In the binding of the WCF-SQL adapter, select the  "InboundOperationType" property to "XMLPolling". The default is "Polling". 
    In the "Polling Statement", ensure the SQL statement which will give results the XML-output as you wanted. So if you have used following statement in SQL management studio, then use the same statement in the "Polling Statement" property
    of the Receive location. Ensure you DON'T remove the "For XML AUTO" statement while configuring the SQL query in receive location. As here you have choose "XMLPolling" as the value for  "InboundOperationType"
    property, the output of the SQL statement should be XML. 
    SELECT Header.ID
    ,Detail.ID
    FROM Header
    JOIN Detail ON Detail.OrderHeaderID = Header.ID
    FOR XML AUTO, ELEMENTS
    Note: You can either use SQL select statement or stored procedure. Even if any of these method used to get the resultset from SQL db, ensure it return the output in XML.
    Above query is what I have used to simulate your case, you can change it to suit your actual SQL table and column names.
    In the "PolledDataAvailableStatement" property I have used the following which would ensure that "Polling Statement" statement executes. I assume you're using this to learn how WCF-SQL adapter works, in real time you may need to update
    the query in SQL so that SQL doesn't return the resultset continuously
    SELECT top 1 Header.OrderID
    ,Detail.DetailID
    FROM Header
    JOIN Detail ON Detail.OrderHeaderID = Header.OrderID
    Try the setting, the structure of the output using the above using "XMLPolling" values in "InboundOperationType" property of the receive location binding will be same as the "FOR XML AUTO, ELEMENTS" in SQL. You may need to change
    the rootname property to suit your actual expected output.
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • FOR XML will not run in stored procedure but will in Query

    The following is the Query and stored procedure for a XML export.  The query runs find and returns a clickable link. The stored procedure does not.
    Stored Procedure
    USE [db]
    declare @XmlOutput1 xml
    set @XmlOutput1 =
    (SELECT incident_num,
    unit_id, unit_status_datetime,
    unit_status_remarks
    FROM unit_status_hist
    where convert(varchar,unit_status_datetime,102)
    =
    convert(varchar,getdate(),102)
    FOR XML
    RAW)
    select @XmlOutput1
    Query:
    use db
    SELECT incident_num, unit_id,
    unit_status_datetime,  unit_status_remarks
    FROM unit_status_hist
    WHERE  convert(varchar,unit_status_datetime,102)
    =
    convert(varchar,getdate(),102)
    for XML
    auto, Elements
    Any help would be greatly appreciated.  Thank you.

    The following is the Query and stored procedure for a XML export.  The query runs find and returns a clickable link. The stored procedure does not.
    Stored Procedure
    USE [db]
    declare @XmlOutput1 xml
    set @XmlOutput1 =
    (SELECT incident_num,
    unit_id, unit_status_datetime,
    unit_status_remarks
    FROM unit_status_hist
    where convert(varchar,unit_status_datetime,102)
    =
    convert(varchar,getdate(),102)
    FOR XML
    RAW)
    select @XmlOutput1
    Query:
    use db
    SELECT incident_num, unit_id,
    unit_status_datetime,  unit_status_remarks
    FROM unit_status_hist
    WHERE  convert(varchar,unit_status_datetime,102)
    =
    convert(varchar,getdate(),102)
    for XML
    auto, Elements
    Any help would be greatly appreciated.  Thank you.
    I cant see any stored procedure here
    both of the code posted are queries only
    also clickable link will come in only SSMS query window. Are you trying to execute this from some application?
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • "for XML path "  Oracle equivalent of this SQL expression

    SELECT TheID,
    REPLACE(
    RTRIM(
    SELECT StudentID + ' '
    FROM StudentinSchoolLocation TL
    WHERE (LocationID = Results.LocationID)
    FOR XML PATH ('')
    ) AS StudentIDs,
    What is the equivalent of 'For XML path' used above
    The goal is to get a concatenated list of the group by columns. Like where ever the location is same , get the studentIds and make a comma seperated list of all ids for common location
    Works perfectly in SQL.
    Thank you

    Hi,
    user6287828 wrote:
    The goal is to get a concatenated list of the group by columns. Like where ever the location is same , get the studentIds and make a comma seperated list of all ids for common locationThat's called "String Aggregation"
    [AskTom.oracle.com|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402] shows several different ways to do it.
    I recommend the first one, the user-defined function STRAGG, which you can copy from that page.
    On Oracle 10 (and up) you may have a similar function, WM_CONCAT (owned by WMSYS), already installed.
    WM_CONCAT is not documented, so you may not want to use it in your Production applications.
    STRAGG is not so convenient if the order of items in the concatenated string is important.
    In that case, use XMLAGG or SYS_CONNECT_BY_PATH, as shown later in the asktom page.
    MODEL can also do ordered string aggregation.

  • URL constructor for XML query

    I can't seem to construct an http SQL query correctly using the Java URL constructor. When I enter the following string in the browser window, everything works fine:
    "http://aaaa.bbb.ccc.com/nwind?sql=select * from employees for xml auto&root=root". The results of the query are displayed in the browser window. I would like to get this to work using the URL and URLConnection classes. It seems I always get some sort of error with a response length of -1. I would appreciate any insight into this problem. Thanks for your help.
    Paul J. Lay
    [email protected]

    Thanks for your prompt reply. I tried your suggestion immediately. It didn't change the results. I still get a response length of -1. You can actually try this yourself by keying in a browser window the following string: www.itsmagical.com/nwind?sql=select * from employees for xml auto&root=root. I can't imagine what the problem could be. Thanks again for your prompt reply.
    Best Regards,
    Paul J. Lay

  • Biztalk WCF-SQL polling sample using a FOR XML Path

    I've been searching in the web for a sample that uses FOR XML "PATH" to poll the SQL database . The result returned from my query is a parent child data and FOR XML PATH is the best choice to structure it in that way . I guess I'm missing something while
    generating the schemas from this stored procedure.
    I guess Dan Rosanova has touched on this concept (http://social.technet.microsoft.com/wiki/contents/articles/3480.aspx)
    , but its using XML Auto. Again there is no sample available so makes things a bit difficult.
    Can someone point to a sample walkthrough , generating the schemas and then later using it in the application.
    Thanks
    Anthstone

    I used XMLPolling and it worked for me. you can go for XMLPolling. Steps to be followed:
    1) Create the SP which will have the SELECT query similar to below:
    ;WITH XMLNAMESPACES (default 'http://yourcustomnamespace')
     Select * from Employee FOR XML PATH('YourCustomRootNode') 
    2) Create a schema out of the table using the following query
    Select * from Employee for
    xml
    auto,
    xmlschema 
    3) Re-name the root name and namespace as per you mentioned in point#1 (YourCustomRootNode)
    4) Create an Envelope Schema and refer the schema from point#3. Also make a note of the root node name and namespace that we need to specify
    in the admin console.
    5) Assign the Body XPath to debatch. Refer
    this.  Deploy the solution.
    6) In the Admin console, add the Root Node Name and namespace mentioned in point#4 under "XmlStoredProcedureRoodNodeName" and "XmlStoredProcedureRoodNodeNamespace"
    There you go. I did this for debatching. You can do for nomarl batch message instead of Envelope create a normal document schema.
    Thanks
    SKGuru

  • Oracle equivalent of SQL Server's "FOR XML" and "OPENXML"

    Hi
    Can someone please tell what are the Oracle's equivalent of SQL Server's "FOR XML" and "OPENXML" features?

    Probably you can try General XML forum General XML
    Gints Plivna
    http://www.gplivna.eu

  • For XML - Oracle Equivalent:

    Hey people,
    I was wondering... SQL server has the 'for xml path' clause; does oracle have its equivalent?
    I wasn't able to find any leads online. Thought the experts here'd know.
    Thanks.
    Edited by: user10175043 on May 23, 2011 11:06 AM

    See this,
    XML parent child records
    G.

  • Oracle DB: How to parse XML where element names are non-standard ?

    I'm in the unfortunate situation that I have illegal XML that I would like Oracle to parse. By 'illegal' in my case is that there are element names that start with an illegal character, such as a digit. Apart from this the XML is syntactically valid.
    Here is an example of the XML I have stored as a column in the database:
    <schedule>
        <1stweek>
        </1stweek>
        <2ndweek>
        </2ndweek>
    </schedule>Right now I'm doing text search-and-replace on the XML text before I let Oracle parse it, for example replacing '<1stweek>' with '<x1stweek>' and so on. Needless to say this is very slow.
    My question is if there is a way to tell the XML parser in the Oracle DB (I'm using version 10.2) to be a bit more forgiving ? ... so that it will accept element names that start with e.g. a digit ? I know that such an option exist in some XML parsers but what about Oracle's and if so how to set the option?
    And before you ask I'll answer myself: No, I'm not the one who created the non-standard XML. It is from a third-party application which I cannot change myself and cannot get the vendor to change either.
    Thank you.

    if you cast your clob to an xmltype then you can search and extract values based on tags.
    Heres an example where the table is a clob and value is cast and I'm looking for an existing attribute_name.
    Check out the Oracle XML developers Guide
    select u.*
    FROM preload_xml
    , XMLTable(
    '/ApplicationProfile/ScriptFragment' PASSING xmltype(xml)
    COLUMNS name varchar2(50 char) PATH '/ScriptFragment/@Name'
    ) u

  • Question on Support for XML in Oracle 9i and XDK 9.0.1

    Hi All,
    I just went through the Oracle 9i's features for XML. I have been working with Oracle's XDK too. I noticed that there are some new packages in Oracle 9i like SYS_XMLGEN and DBMS_XMLGEN that produce a XML file when presented a query to it. This feature is there in the XDK (XML SQL Utility) too. So, my question is as follows:
    1. Are there any differences in the XML File produced by XDK and these database packages?
    2. What are the scenerios when I should go for these packages and when should I go for the XSQL Utility.
    Cos I found out that both are doing effectively the same things. Is there any difference between them? Please explain the second question.
    Thanks in advance,
    Rajat

    The sys_xmlagg and sys_xmlgen are native implementations of functionality tied into the database code line. They replicate some of the functionality that was previously provided in a 'plugin' form by the XDK. DBMS_XMLGEN is a PLSQL Package that also provides access to native implimentations of some of this functionalitu. You should find that as a result of being native implimentation they are much more performant.
    SYS_XMLGEN and SYS_XMLAGG allow XML to be generated directly from a SQL Query. DBMS_XMLGEN is designed for use in procedural processing and provides a finer grain of control over the generated output.
    There are still some features, such as DTD and Schema generation that are not (yet) available with the native implementation, and for this reason, and backwards compatability the XDK functionality is still available
    As a rules of thumb, if you can use the native implimentations do so, as performance should be much better.
    Mark D. Drake
    Senior Product Manager,
    XML Infrastructure,
    Server Technology

  • Looking for the oracle equivalent of T-SQL 'SELECT TOP n'

    Hi,
    I'm looking for the Oracle equivalent of T-SQL 'SELECT TOP n'
    and can't find any. There is SAMPLE(n) function but it supposed
    to pick up random values and I'm not sure if it's possible to
    make it select top values. Please help 8-)
    Thanx

    Hi Marina.
    Oracle does not have a functionality like SQL Server for TOP
    selection. The ROWNUM option should be used with great care and
    you may get unreliable results.
    Try looking at Metalink
    Doc ID: 291065.999
    Doc ID: 267329.999
    - They discuss this issue, and solutions.

  • Does oracle have similar functionality like MsSql "for xml path('')"

    Does oracle have similar build in functionality like MsSql “for xml path(‘’)” , or in another word, it can enforce the result set(multiple rows) into ONE line such kind of presentation way.
    Thanks in advance. Any help would be greatly appreciated.

    Here I would like specify my question mnore clearly,
    CREATE TABLE t(
    line NUMBER(3),
    site VARCHAR2(4),
    phase VARCHAR2(5),
    test VARCHAR2(25));
    INSERT INTO t VALUES (1, '0100', '*','1111111111111111111111111' );
    INSERT INTO t VALUES (2, '0100', '=','2222222222222222222222222' );
    INSERT INTO t VALUES (3, '0100', '=','3333333333333333333333333' );
    INSERT INTO t VALUES (4, '0100', '*','4444444444444444444444444' );
    INSERT INTO t VALUES (5, '0100', '=','5555555555555555555555555' );
    INSERT INTO t VALUES (6, '0200', '*','6666666666666666666666666' );
    Here I want to retrieve the 'line' column information in ONE line way
    select line from t I want the result is like '1,2,3,4,5,6'
    Any generous help would be greatly appreciated!!!

Maybe you are looking for

  • After upgrading to Acrobat Reader DC, the Fill & Sign toolbar is empty.

    I have a PDF I need to initial daily, and I've been having trouble since upgrading to Adobe DC. When I open the Fill & Sign toolbar, there are no options on the bar. If someone signs and saves the PDF, I can then see the toolbar options when I reopen

  • Capturing attendance type in Time type

    Hi All, I have bit idea about time types which I learnt from SCN only. I want an absence type to be captured in a time type .I have created a time type and maintained it in T555Y (TM04 schema). What other steps I need to do so that I can see that hou

  • CRMM_ACCOUNT - Change Labels

    Hi,    I am trying to change the Texts of the Labels in the CRMM_ACCOUNT PCUI Application. The issue is with the Labels on the General Information Tab. The Field Group is ACC_GENERAL_DATA which has a reference to ACC_SRES_01_V1. I have maintained the

  • Firefox performance issues

    So far I really like Arch... but any help with this problem would be great. I have moved from Gentoo to Arch and so far really like it. I am using LVM on LUKS encrypted partition, with KDE base for a desktop manager.  This all works perfectly and I a

  • Presenter 8 Missing from eLearning Suite CS6 Install

    After installing Adobe eLearning Suite CS6, I have a folder under startup with that name. See below for what programs are installed.. I am assuming that the Presenter Video Creator is an additional portion of the program.  Can anyone tell me where th