Is there a tool to view / get the SQL XML format?

Hello
Work on Oracle 11g R2 SOE.
It is my first try with XML function, suppose I have a query similar to the one mentioned here, how to get a well formatted by this query XML file?
I run on SQL Plus and tried 'Spool' in the xml file, but information was not in XML format.
select xmlelement(
         "DEPARTMENTS",
         xmlagg(
           xmlelement(
             "DEPARTMENT",
             xmlforest(
               d.deptno,
               d.dname,
               (
                 select xmlagg(
                          xmlelement(
                            "EMPLOYEE",
                             xmlforest(
                               e.empno,
                               xmlcdata(e.ename) ename,
                               e.hiredate
                             )
                           )
                        )
                 from   emp e
                 where  e.deptno = d.deptno and
                        e.empno in (7369, 7499, 7934)
               ) employees
             )
           )
         )
       ) x
from   dept d;
Kind regards
Fateh

Fateh says:
Thank you
Yes, I meant by good - as XML, the same format you obtained as a result of your query.

The point is that the expression "well formatted" in terms XML, means an XML document that has the opening and closing etc and responds to the XML standard. It does not mean one that is displayed in a way enough with all the beautiful indented of the hierarchy. This is called a "pretty print" XML document

As Odie, for technical purposes you need only a well formatted XML document, because if you insist on using a pretty print XML, then you introduce a lot of white space in the document, which will make the XML content conisiderably of large files for example more big or bigger storage required. To treat XML programmatically there not enough print XML at all.

So, why do you need your print by little data?

If you have data stored in an XML file, you can simply open it in a web browser and it will present this pretty print for you... If it's just a case of you want to be able to browse the data for testing etc.

Tags: Database

Similar Questions

  • Y at - it an easy way to get the sql code that is sent in the query UPDATE

    I have a request to UPDATE abbreviated for readability. Is there an easy way to get the sql code that is sent? I use get this info for sql select in the display of debugging in cfeclipse but not for the UPDATE.

    < cfquery debug = "" name = "q" datasource = "#datasource #" > "



    UPDATE [BookingSystem]. [dbo]. [tbTrades]
    SET
    [Status] = #MATCHED_STATUS #.
    WHERE

    clientID = < cfqueryparam value = "" #arguments.clientID # "cfsqltype ="cf_sql_integer"> AND"

    < / cfquery >

    It might pay to read the docs for - http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_17.html#1102316 - focusing on the RESULT parameter.

    Read also about debugging in CF: http://livedocs.adobe.com/coldfusion/8/htmldocs/Debug_01.html

    --

    Adam

  • age of empires 3 product lost key.is there a way I can get the key.i have the box and cert of authenticity and all code cd

    age of empires 3 product lost key.is there a way I can get the key.i have the box and cert of authenticity and all code cd

    Hi barryholt,

    You can see the following article for more information on the same.

    How to get a new product key for Microsoft Games for Windows, Streets & Trips, or MapPoint

  • Is there a tool to check if the appropriate data are insertion or not?

    Hello

    We have different products A, B and C.
    whenever the crates one user account in respect of those products of the X, Y, Z table is updated.

    If the util_1 create an account under a then X, Y, Z updated with data as well as some ID tables
    If the User2 creates an account under a then X, Y, tables Z update with the SAME DATA as well as some other ID

    Is there a tool to check if the appropriate data insertion (insert same data each time) or not?

    Thank you
    Praveen

    Is there a tool to check if the appropriate data insertion (insert same data each time) or not?

    Yes. It's called "Visual inspection of the results of a SQL query.

    Taking into account your needs (If user1 user2, then X actions then actions Y), the database is unable to validate data. You will need to write queries that present the data. Now you can visually the data.

    You can build a test harness (a set of procedures PLSQL) what to do the validation for you if the volumes are so high that you cannot visually inspect the data. The developers are the best people to create the test suite.

    Hemant K Collette

  • is there an easy way to get the number of months in a year in a date range?

    Hi, experts, I am a newbie.

    are there any easy ways to get the number of months in a year in a date range?

    I would like to write a user-defined function.

    the input parameters are startdate, enddate, year

    the output is a number, not a month.

    for example, case 1

    StartDate = 01032009 (DDMMYYYY)
    end date = 28022010 (DDMMYYYY)
    If the year 2009, the output is 10
    If the year = 2010, the output is 2

    case 2:

    StartDate = 10032009 (DDMMYYYY)
    end date = 15032010 (DDMMYYYY)
    If the year 2009, the output is 10
    If the year = 2010, the output is 3

    Thank you very much!

    Hello

    You can (also) try this:

    SQL> with s as (
      2  ------------ Sample data -------------
      3  select to_date('01032009','ddmmyyyy') startdt, to_date('28022010','ddmmyyyy') enddt, 2009 yr from dual
      4  union all
      5  select to_date('01032009','ddmmyyyy') startdt, to_date('28022010','ddmmyyyy') enddt, 2010 yr from dual
      6  union all
      7  select to_date('10032009','ddmmyyyy') startdt, to_date('15032010','ddmmyyyy') enddt, 2009 yr from dual
      8  union all
      9  select to_date('10032009','ddmmyyyy') startdt, to_date('15032010','ddmmyyyy') enddt, 2010 yr from dual
     10  ------------ Sample data -------------
     11  )
     12  select startdt, enddt, yr,
     13  months_between(
     14          least(trunc(to_date(yr+1,'yyyy'),'year') , add_months(trunc(enddt,'month'),1))
     15          , greatest(trunc(to_date(yr,'yyyy'),'year') , trunc(startdt,'month'))
     16  ) nbmonths
     17  from s;
    
    STARTDT    ENDDT              YR   NBMONTHS
    ---------- ---------- ---------- ----------
    01/03/2009 28/02/2010       2009         10
    01/03/2009 28/02/2010       2010          2
    10/03/2009 15/03/2010       2009         10
    10/03/2009 15/03/2010       2010          3
    

    It's pretty simple. (no connection with, without functions SQL only integrated multicast, etc...)

  • Get the SQL statement error programmatically

    Hello

    error SQL in the FORMS, you can display the erroneous SQL statement pressing (shift) (Ctrl) E on the screen. Is there a way to get the text of the SQL statement in a PL/SQL function for logging purposes?

    I get the error using SQLERRM, it's not a problem. But how can I get the SQL text of the statement?

    Thanks and regards,

    Sascha

    Sascha,

    You should be able to use the: SYSTEM. System LAST_QUERY variable forms.

    Craig...

  • Can someone please tell me the "see correct / more effective to get the 'status' XML ' attributes

    Can someone please tell me the "see correct / more effective to get the 'status' XML ' attributes (ID, CssClass, Description and IsActive to the XML code below):

    Implementation will be the standalone .swf file

    (XML)

    <ArrayOfLineStatus>
    <LineStatus ID="0" StatusDetails="">
        <BranchDisruptions/><Line ID="1" Name="Bakerloo"/>
        <Status ID="GS" CssClass="GoodService" Description="Good Service" IsActive="true">         
             <StatusType ID="1" Description="Line"/></Status></LineStatus>
    </ArrayOfLineStatus>

    < ArrayOfLineStatus >

    < LineStatus ID = "0" StatusDetails = "" >

    < BranchDisruptions / >

    < line ID = "1" Name = "Bakerloo" / >

    < State ID = 'GS' CssClass = "GoodService" Description = "Good Service" IsActive = "true" >

    < StatusType ID = '1' Description = 'Line' / > < / status >

    < / LineStatus >

    < / ArrayOfLineStatus >

    There is no good way with as2:

    trace(this.firstChild.childNodes[1].childNodes[4].) Attributes ['ID']);

    trace(this.firstChild.childNodes[1].childNodes[4].) Attributes ['CssClass']);

    etc.

  • How can I get the original xml code to a webservice called...

    I use WL 10.3.

    I created a WebService using WSDL as a starting point. The Web service is running as it should, but now I want to go back to the original XML that was passed in.

    I tried to collect the data to a string using JAXB, but he complains that there is no notation for @XmlRootElement - so, who does not work.

    I also tried to access the original data by injecting the WebServiceContext, but this value is always zero (not sure why that doesn't work)...


    Is someone can you PLEASE tell me how can I get the original XML code?

    You can use managers to this end, for example,

    package server.handlers;
    
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.ws.LogicalMessage;
    import javax.xml.ws.handler.LogicalHandler;
    import javax.xml.ws.handler.LogicalMessageContext;
    import javax.xml.ws.handler.MessageContext;
    
    public class ServiceLogicalHandler implements LogicalHandler {
    
        public boolean handleMessage(LogicalMessageContext context) {
            Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (direction) {
                System.out.println("LOGICAL - DIRECTION IS OUTBOUND");
            } else {
                System.out.println("LOGICAL - DIRECTION IS INBOUND");
            }
            return true;
        }
    
        public boolean handleFault(LogicalMessageContext context) {
            Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (direction) {
                System.out.println("LOGICALFAULT - DIRECTION IS OUTBOUND");
    
                LogicalMessage message = context.getMessage();
                Source payload = message.getPayload();
                try {
                    Transformer transformer = TransformerFactory.newInstance().newTransformer();
                    transformer.transform(payload, new StreamResult(System.out));
                } catch (TransformerException ex) {
                    ex.printStackTrace();
                }
            } else {
                System.out.println("LOGICALFAULT - DIRECTION IS INBOUND");
            }
            return true;
        }
    
        public void close(MessageContext context) {
        }
    }
    

    More information on managers can be found here: http://www.javaworld.com/javaworld/jw-02-2007/jw-02-handler.html

  • External hard drive does not work. Is there another way I could solve the problem without formatting the external hard drive?

    My external hard drive works. I tried to plug and when I tried to open it, it says to format the drive until I could use it. Everything works well as when I plugged the USB icon shown on the screen. When I check the disk management, it showed that the partition of the drive is there.

    I tried to change the drive letters, but still having the same problem. I also tried to run the disk check on the command prompt and the properties of the drive, but it still can not because there is error popping up saying that the disk check cannot be performed because Windows cannot access the disk.

    Is there another way I could solve the problem without formatting the external hard drive?

    I tried the first step in troubleshooting the hard drive, but it gives a
    error in saying that "hardware changes might not have been detected.

    So I tried the second method, and when I click on the "Check now" button his
    gives an error saying that "the disk check cannot be performed because .
    Windows can not access the disk".".

    So is there any other way or option?

    Thank you

    Jason

  • Is there a tool out of all the windows configuration settings? (gpedit.msc, services.msc)

    I am trying to build an audit tool to extract the Windows of my environment settings, and it compares with planning what I defined. This baseline scenario specifies in detail what settings should be enabled / disabled / how it should be configured.

    Because it is a large scale environment, and I know exactly what I need, I would build a tool of mine.  I've used such gpresult and secedit commands to get the settings but I can't get all the settings.  I've already got many settings in the registry, but it works to be a bit heavy.

    Most of the settings I need are in gpedit.msc, services.msc, although I can't get in/out these values by using a script.

    For example -.
    Store passwords using reversible encryption for all users in the domain = on (or off)

    This setting is in gpedit, but I can't find this setting in the registry / other functions of command line.  I noticed that most of the information is readily available in gpedit.msc / services.msc although I don't know how to automate the extraction of these parameters.

    Could you please help to automate the extraction of these parameters?  I want ths process is transparent to the user / server administrator to reduce the interaction required for the information.  A macro will not allow the extraction of these parameters, while the computer is locked.

    I'm looking for Windows 2003, XP and 7.

    Thanx

    Hello

    Your Windows Xp issue is more complex, while we usually answer on the Microsoft Answers site, you can post the question on the link provided below for assistance.

    http://social.technet.Microsoft.com/forums/en-us/category/windowsxpitpro

  • Is there a java script to get the Server datetime in CC &amp; B?

    Hi all:
    We want to get the Server datetime in UIMap? If the for get java script the Server datetime in CC & B are there? all we should create a Server Script?

    JavaScript is client so that you would need a script on the side-side server to do this, probably a Script Service (SS) called for example from the "onload" event to the UI mapping body. SS does nothing but fills one with $CURRENT - DTMC. Diagram of the SS becomes an integral part of the user interface card is .

    But what would be the requirement that you want to display Date/time of the server in terms of user interface, before even that the user is committed to the Transaction.
    If there is still a need for this, you can display the local time but always use the $CURRENT-DTTM/%CurrentDateTime on the server to add/update registration / transaction.

  • Is there an easy way to get the previous record in the Apex?

    I'm new to APEX/Oracle, but have a lot of expierence as a mainframe programmer and some experience with SQL.

    I have been instructed by my boss to create a set of pages in an application like this.

    Page 1: Select an employee name and go to Page 2.

    Page 2: View employee biography information.
    Add a 'Next employee' button and a button "Previous employee" who picks the previous employees respectively biography info.

    Essentially, he wants a query with information biography of each employee with an employee selected on page 1, used as pointer to start.

    I built successfully "select the name of an employee on page 1" and "show its info on page 2" with a query that returns a single record.

    What I can not know is how to get a next and previous button for the next or previous record in a record multi query, using the initially selected employee as intial pointer.

    Is their an easy way to build this using functionailty of integrated APEX, or will it require programming to reach this requirement?

    Just realized that I didn't fully answer your question. According to the number of employees, you can create a collection to contain all the information and who travels with buttons. Or you could include a calculation to transmit the current employee, previous and next to your second page using the standard apex_application.gf01... GFN see the creation process to get the id of current line
    Keep smiling,
    Bob R

  • How to get the SQL if I get exception

    I get this exception and do not know what was the actual sql with the variables of liaison who was executed.



    sqlmesg = error in the select query to retrieve the segment associated with a pair of cables: ORA-01006: there is no bind variable

    y at - it a way to get the real sql executed so I know what mistake I did.

    I thought your question was about how to view the SQL statement and bind variables in the exception. The answer to that is to put variables in the exception message.

    The root cause of the problem seems to be that your dynamic SQL statement may require 3 or4 variable bind but your USING clause specifies always 4 values if the underlying SQL statement has 3 positions, it will lead to an error.

    Justin

  • Possible to get the European date format by default without UK correction?

    I have some terrible evil with the terrible in Excel and other programs American date format when I have my computer, the value of the American region.

    I thought I fixed that by changing just my computer region UK but now I have GBP currency by default and autocorrects obnoxious affecting my Z s and add unnecessary U in every way.

    I live in a non-English speaking part of Europe, but my native language is English and I work mainly with the dollar sign ($).  Is there anyway to get the normal spelling, the right currency by default ($), 24 hours, but without the fool US default date format?

    Thank you.

    Explore SystemPreferences settings: language and region and the Advanced button.

  • How to get the sql query result?

    Hello

    Currently I use LV2012 to connect to an Oracle database server. After the Oracle Express and Oracle ODBC driver facilities/settings made.

    I managed to use the SQL command to query the data through my command prompt window.

    Now the problem is, how to do the same task in Labview using database connectivity tools?

    I have build a VI to query as being attached, but I have no idea of what range to use to get the result of the query.

    Please help me ~ ~

    Here is a piece of code that I use to test the SQL commands, you can use the part that retrieves the results of sql.

    It is also possible to get the rear column headers, but it's for the next lesson!

    ;-)

Maybe you are looking for