Need the output of a query in given XML format

I have a table as
create table t_cases (case_id number, pros_seq number, case_lname varchar2(100),
day_phone number, night_phone number, intl_phone number);
where case_id and pros_seq is the compound primary key.
The insert script to insert the data in the table is
insert into t_cases values(1, 1, 'test', 12, 23, 34);
insert into t_cases values(1, 2, 'test', 56, 67, 78);
commit;
Now from this table I need to query and fetch the data in the following xml format.
<case REPEATINGTYPE="PageList">
<rowdata REPEATINGINDEX="1">
<caseid>1</caseid>
<prosseq>1</prosseq>
<PhoneNumbers REPEATINGTYPE="PageList">
<rowdata REPEATINGINDEX="1">
<CountryCode>12</CountryCode>
<Type>Day</Type>
</rowdata>
<rowdata REPEATINGINDEX="2">
<CountryCode>23</CountryCode>
<Type>Night</Type>
</rowdata>
<rowdata REPEATINGINDEX="3">
<CountryCode>34</CountryCode>
<Type>International</Type>
</rowdata>
</PhoneNumbers>
</rowdata>
<rowdata REPEATINGINDEX="2">
<caseid>1</caseid>
<prosseq>2</prosseq>
<PhoneNumbers REPEATINGTYPE="PageList">
<rowdata REPEATINGINDEX="1">
<CountryCode>56</CountryCode>
<Type>Day</Type>
</rowdata>
<rowdata REPEATINGINDEX="2">
<CountryCode>67</CountryCode>
<Type>Night</Type>
</rowdata>
<rowdata REPEATINGINDEX="3">
<CountryCode>78</CountryCode>
<Type>International</Type>
</rowdata>
</PhoneNumbers>
</rowdata>
</case>
Please let me know how to do this.

Like this...
select XMLELEMENT( "case", XMLATTRIBUTES ('PageList' as "RepeatingType")
                 ,xmlagg(
                          xmlelement("rowdata", xmlattributes(pros_seq as "RepeatingIndex")
                                    ,xmlelement("caseid", case_id)
                                    ,xmlelement("prosseq", pros_seq)
                                    ,xmlelement("PhoneNumbers", xmlattributes('PageList' as "RepeatingType")
                                               ,xmlelement("rowdata", xmlattributes(1 as "RepeatingIndex")
                                                          ,xmlelement("CountryCode", day_phone)
                                                          ,xmlelement("Type", 'Day')
                                               ,xmlelement("rowdata", xmlattributes(2 as "RepeatingIndex")
                                                          ,xmlelement("CountryCode", night_phone)
                                                          ,xmlelement("Type", 'Night')
                                               ,xmlelement("rowdata", xmlattributes(3 as "RepeatingIndex")
                                                          ,xmlelement("CountryCode", intl_phone)
                                                          ,xmlelement("Type", 'International')
        as x
from t_cases

Similar Messages

  • Need output of a query in given xml format.

    I have a table as
    create table t_cases (case_id number, pros_seq number, case_lname varchar2(100),
    day_phone number, night_phone number, intl_phone number);
    where case_id and pros_seq is the compound primary key.
    The insert script to insert the data in the table is
    insert into t_cases values(1, 1, 'test', 12, 23, 34);
    insert into t_cases values(1, 2, 'test', 56, 67, 78);
    commit;
    Now from this table I need to query and fetch the data in the following xml format.
    <case REPEATINGTYPE="PageList">
         <rowdata REPEATINGINDEX="1">
              <caseid>1</caseid>
              <prosseq>1</prosseq>
              <PhoneNumbers REPEATINGTYPE="PageList">
              <rowdata REPEATINGINDEX="1">
                   <CountryCode>12</CountryCode>
                   <Type>Day</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="2">
                   <CountryCode>23</CountryCode>
                   <Type>Night</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="3">
                   <CountryCode>34</CountryCode>
                   <Type>International</Type>
              </rowdata>
              </PhoneNumbers>
         </rowdata>
         <rowdata REPEATINGINDEX="2">
              <caseid>1</caseid>
              <prosseq>2</prosseq>
              <PhoneNumbers REPEATINGTYPE="PageList">
              <rowdata REPEATINGINDEX="1">
                   <CountryCode>56</CountryCode>
                   <Type>Day</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="2">
                   <CountryCode>67</CountryCode>
                   <Type>Night</Type>
              </rowdata>
              <rowdata REPEATINGINDEX="3">
                   <CountryCode>78</CountryCode>
                   <Type>International</Type>
              </rowdata>
              </PhoneNumbers>
         </rowdata>
    </case>
    Please let me know how to do this.

    Like this...
    select XMLELEMENT( "case", XMLATTRIBUTES ('PageList' as "RepeatingType")
                     ,xmlagg(
                              xmlelement("rowdata", xmlattributes(pros_seq as "RepeatingIndex")
                                        ,xmlelement("caseid", case_id)
                                        ,xmlelement("prosseq", pros_seq)
                                        ,xmlelement("PhoneNumbers", xmlattributes('PageList' as "RepeatingType")
                                                   ,xmlelement("rowdata", xmlattributes(1 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", day_phone)
                                                              ,xmlelement("Type", 'Day')
                                                   ,xmlelement("rowdata", xmlattributes(2 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", night_phone)
                                                              ,xmlelement("Type", 'Night')
                                                   ,xmlelement("rowdata", xmlattributes(3 as "RepeatingIndex")
                                                              ,xmlelement("CountryCode", intl_phone)
                                                              ,xmlelement("Type", 'International')
            as x
    from t_cases

  • Procedure to save the output of a query into excel file or flat file

    Procedure to save the output of a query into excel file or flat file
    I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
    I have run the query --
    DECLARE @cmd VARCHAR(255)
    SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
    Exec xp_cmdshell @cmd
    error message--
    SQLState = 28000, NativeError = 18456
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
    NULL
    Goel.Aman

    Hello,
    -T:
    Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
    login_id, and password are not required. If
    –T is not specified, you need to specify
    –U and –P to successfully log in.
    -U:
    Specifies the login ID used to connect to SQL Server.
    Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
    -T option (trusted connection) instead of the
    user name and password combination
    I would suggest you take a look at the following article:
    bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
    A similar thread regarding this issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
    Regards,
    Elvis Long
    TechNet Community Support

  • Get the output of a query in a textpad..

    Hi..
    I need to get the output of a query in a notepad..
    Can anyone help me..

    spool c:\emp.txt
    fire select * from emp;
    spool off;
    go to c: and check your text file.
    hare krishna
    Alok

  • Proxy To file scenario : need the output in hierarchial structure

    Hi all,
    I am doing a proxy to file scenario. Now I am getting the output as :
    <documents>
    <document>
    <header>
    <delivery_number></delivery_number>
    <tax_number/>
    u2026
    </header>
    <data>
    u2026
    </data>
    </document>
    <document>
    <header>
      u2026
    </header>
    <data>
       u2026
    </data>
    </document>
    u2026
    </documents>
    But I would like to change the output to below structure.
    <documents>
               <document>
         <header>
                                 <delivery_number></delivery_number>
                                 <tax_number/>
                                  u2026
                         </header>
         <data>
                                     u2026
                          </data>
               </document>
               <document>
         <header>
                                 u2026
                          </header>
         <data>
                                u2026
                         </data>
                 </document>
    u2026
    </documents>
    Can anyone suggest me how can I get this?
    Thanks,
    Arivarasu S
    Edited by: Arivarasu S on Jan 31, 2011 2:54 PM
    Edited by: Arivarasu S on Jan 31, 2011 3:00 PM

    <documents>
          <document>
                <header>
                           <delivery_number></delivery_number>
                            <tax_number/>
                                      u2026
                 </header>
                 <data>
                            u2026
                  </data>
           </document>
    </documents>
    I need the output as mentioned above.. pls let me know how can i achieve this..
    Thanks,
    Arivarasu S
    Edited by: Arivarasu S on Jan 31, 2011 6:59 PM

  • Spooling the output of a Query with out displaying the rows

    Hello All,
    Is it possible to spool the output of
    a query/dbms_output.put_line with out displaying
    the Query output on the console.
    In my case,list of rows in the output is huge, I want
    to eliminate displaying the output of query
    so that spooling will complete faster.
    Thanks in advance.
    -Srini

    You can do:
    SET TERMOUT OFFIn your script before doing the spool command.
    You will have to write your query as a .SQL script and run it from SQL*Plus in order for it to work the way you expect.
    sqlplus -s username/password @query_script.SQL

  • How to convert the output of Applescript which is in object format to text or string format??

    Hi All,
    I want to convert the output of Applescript which is in object format to string or text format, am running Applescript with Java, I need to display the output of applescript in Eclipse Java Console, since its object format the output is not properly displayed..
    Pls suggest.. I used the below code
    repeat with i in allContents
                if class of i is button then set the end of allStaticText to contents of i
            end repeat
    Applscript ouptput
    {button 1 of window "Player Installer" of application process "Install  Player" of application "System Events", button 2 of window "Player Installer" of application process "Install  Player" of application "System Events", button 3 of window "Player Installer" of application process "Install  Player" of application "System Events", button "Finish" of UI element 1 of scroll area 1 of window "Player Installer" of application process "Install  Player" of application "System Events"}
    Java output
    <NSAppleEventDescriptor: 'obj '{ 'form':'indx', 'want':'butT', 'seld':1, 'from':'obj '{ 'form':'name', 'want':'cwin', 'seld':'utxt'(" Player Installer"), 'from':'obj '{ 'form':'name', 'want':'pcap', 'seld':'utxt'("Install  Player"), 'from':'null'() } } }>

    Here's an improved version of the previous script, where the handler now returns "button 2 of window \"Untitled\" of application process \"TextEdit\" of application \"System Events\"" instead of "button \"2\" of window \"Untitled\" of application process \"TextEdit\" of application \"System Events\"":
    tell application "System Events"
        get button 2 of window 1 of process "TextEdit"
        my objectToText(result) --> "button 2 of window \"Untitled\" of application process \"TextEdit\" of application \"System Events\""
    end tell
    on objectToText(UI_element)
        set theText to ""
        tell application "System Events"
            repeat
                if exists attribute "AXParent" of UI_element then
                    set theParent to value of attribute "AXParent" of UI_element
                    set theClass to class of UI_element
                    if name of UI_element exists then
                        set theName to name of UI_element
                        set theText to theText & (theClass as text) & " \"" & theName & "\" of "
                    else
                        set k to 0
                        get UI elements of theParent whose class is theClass
                        repeat with thisItem in result
                            set k to k + 1
                            if contents of thisItem is UI_element then exit repeat
                        end repeat
                        set theIndex to k
                        set theText to theText & (theClass as text) & " " & theIndex & " of "
                    end if
                    set UI_element to theParent
                else
                    set theClass to class of UI_element
                    set theName to name of UI_element
                    set theText to theText & (theClass as text) & " \"" & theName & "\" of application \"System Events\""
                    exit repeat
                end if
            end repeat
        end tell
        return theText
    end objectToText
    Message was edited by: Pierre L.

  • Saving the output of a .sql file in .csv format

    Hi,
    I am saving the output of a .sql file in .csv format. But the problem is , the record of few columns have "new line" character in it, so when it is getting saved in .csv format, those records are coming in multiple rows, but they should come in one single row in single block. Please advise how to overcome this problem.
    Regards,
    Niraj

    Hi Guys,
    I guess, there is a misunderstanding.
    He is talking about the issue caused as a result of the data containing a "CRLF" ( Carriage return Line feed ) .
    That is mainly a data issue.
    The query i presume, must be right.
    I guess you should be able to fix it using some string functions.
    Some thing similar to this
    CREATE TABLE ASH (NAME VARCHAR2(10))
    SELECT REPLACE(NAME, CHR(13)||CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(13), 'ISH') FROM ASH;
    depending on the type of new line whether it is CR or LF. or CRLF.
    Regards
    Ashish/-

  • Output query result in XML format

    folks:
    could anybody provide more information
    about how to generate query result in
    xml format? looks like DBXML is for demo only
    and i have heard that PLSQL XML parser is the way to go; so far i have not found
    a sample yet on how to actually
    do the XML generation; if you know more
    about it, please let me know; thanks in
    advance.
    Bill

    Here are some sample apps that might interest you:
    [list]
    [*][url [URL=http://technet.oracle.com/tech/xml/xsql_servlet/index2.htm?Code&files/ffhome.html]The]http://technet.oracle.com/tech/xml/xsql_servlet/index2.htm?Code&files/ffhome.html]The XML Flight Finder
    [*][url [URL=http://technet.oracle.com/sample_code/tech/xml/xmlb2b/doc/xb2bhome.html]B2B]http://technet.oracle.com/sample_code/tech/xml/xmlb2b/doc/xb2bhome.html]B2B with XML
    [list]
    Enjoy,
    -rh

  • I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button.  When the butten is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format.  Is there a quick fix?

    I am creating a form on LiveCycle Designer and I am trying to create a form that has a e-mail submit button.  When the button is utilized it attaches the form to the e-mail in an plain text .xml format rather than the pdf format.  Is there a quick fix?

    Hi,
    You have the choice between xml or pdf, in later versions of designer you can choose with a dropdown on the email button Object palette, the "Submit As";
    In earlier version you had to edit the XML Source and change the format from xml to pdf (or vice-versa);
    Regards
    Bruce

  • How to fill matrix with the output of recordset query?

    Hi all,
    I want a user matrix to load data when I hit a button and the data to be filled is the output of an sql query. binding the matrix columns with table columns and then load the matrix with DBDatasource attached to that table will not do in this case as the columns in the sql query are from several different tables or views. 
    writing following line to do this takes several minutes to load the data:
    For j = 0 To Reordset.RecordCount - 1
    Matrix.AddRow()
    Matrix.Columns.Item("col1").Cells.Item(i).Specific.value =  Recordset.Fields.Item("cardcode").Value
    Recordset.movenext()
    next
    Is there any other way to fill the matrix in this case, which loads the data faster?
    Regards,

    Hello Binita,
    I've tested the CFL for DataTable-Matrixes in my test-AddOn. But there's still one problem left. Maybe you find it out (I will need this in the future too...).
    The ChooseFromList must be added behind the DataTable-Bind, which is done on every MTX-Load (it's not from the sample above, so the UIDs are new ones):
                oDt = oDts.Item("dt_test")
                query = "SELECT  * FROM [@T_CONVTOOLS01]"
                oDt.ExecuteQuery(query)
                oMtx.Columns.Item("0").DataBind.Bind("dt_test", "Code")
                oMtx.Columns.Item("1").DataBind.Bind("dt_test", "U_Alpha01")
                oMtx.Columns.Item("2").DataBind.Bind("dt_test", "U_Price01")
                oMtx.Columns.Item("3").DataBind.Bind("dt_test", "U_Quant01")
                oMtx.Columns.Item("4").DataBind.Bind("dt_test", "U_Date01")
                AddChooseFromLists()
                oMtx.LoadFromDataSource()
    ...where AddChooseFromLists() is...
      Private Shared Sub AddChooseFromLists()
            Try
                Dim oCfls As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                Dim oCfl As SAPbouiCOM.ChooseFromList
                Dim oCflCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                Dim oBtn As SAPbouiCOM.Button
                Dim oMtx As SAPbouiCOM.Matrix
                Dim oCol As SAPbouiCOM.Column
                Dim oEtx As SAPbouiCOM.EditText
                oMtx = oForm.Items.Item("MTX_TEST02").Specific
                oCfls = oForm.ChooseFromLists
                oCflCreationParams = SboCon.SboUI.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                oCflCreationParams.MultiSelection = False
                oCflCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner
                oCflCreationParams.UniqueID = "CFL_C1"
                oCfl = oCfls.Add(oCflCreationParams)
                '### OPTION:
                '# Shown ChooseFromList restricted by Conditions
                oCons = oCfl.GetConditions()
                oCon = oCons.Add()
                oCon.Alias = "CardType"
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "C"
                oCfl.SetConditions(oCons)
                oCol = oMtx.Columns.Item("1")
                oCol.ChooseFromListUID = "CFL_C1"
                oCol.ChooseFromListAlias = "CardCode"
            Catch e As Exception
                Microsoft.VisualBasic.MsgBox(className & ".AddChooseFromLists()" & vbCrLf & "Exception:" & vbCrLf & e.Message.ToString)
            End Try
        End Sub
    But I'm running into problems when trying to set the MTX-Cell via DataTable at the CFL-Event (see comment):
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                    Dim oMtx As SAPbouiCOM.Matrix
                    Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent
                    Dim oCFL As SAPbouiCOM.ChooseFromList
                    Dim oDataTable As SAPbouiCOM.DataTable
                    Dim cflID As String
                    Dim oDt As SAPbouiCOM.DataTable = oForm.DataSources.DataTables.Item("dt_test")
                    oCFLEvent = pVal
                    cflID = oCFLEvent.ChooseFromListUID
                    'Dim oForm As SAPbouiCOM.Form
                    'oForm = SboConnection.SboUI.Forms.Item(FormUID)
                    oCFL = oForm.ChooseFromLists.Item(cflID)
                    If Not oCFLEvent.BeforeAction Then
                        oDataTable = oCFLEvent.SelectedObjects
                        If oDataTable Is Nothing Then Exit Sub
                        '############## Matrix Test #######################################################################
                        If (oCFLEvent.ItemUID = "MTX_TEST02") Then
                            oMtx = oForm.Items.Item("MTX_TEST02").Specific
                            '### CFL Results to UserForm
                            oDt.Rows.Offset = oCFLEvent.Row - 1
                            MsgBox(oDt.GetValue("U_Alpha01", oCFLEvent.Row - 1))
                            MsgBox(oDataTable.GetValue("CardCode", 0))
                            ' PROBLEM - can't get this working - don't know at the moment:
                            ' on other forms SetValue works....
                            oDt.SetValue("U_Alpha01", oCFLEvent.Row - 1, oDataTable.GetValue("CardCode", 0))
                            ' this also gives me problems...:
                            'oMtx.Columns.Item("1").Cells.Item(oCFLEvent.Row).Specific.value = oDataTable.GetValue("CardCode", 0)
                            oForm.Update()
                        End If
                    End If
                End If
    The CFL-Form opens and returns the choosen value(s) at the CFL-event. But writing to MTX still not works with this code...
    Maybe you find the last piece. If so: please write here.
    Cheers,
    Roland
    p.s.:
    David Nussböck wrote
    LOL - ROLAND WAS FASTER ))
    ...just one minute...

  • Modifying the structure of the output by adhoc query designer

    Hi,
    Is there any way of modifying the output structure[row, column width, background color,font ] of the result given by the ad-hoc query in WAD.
    I want to change the font,size, color of the text output given by executing the query using the ad-hoc query designer.
    Please let me know if i can modify some class or method to do so or any other possibility?
    Thanks
    Sachin

    Hi Sachin,
    If you are designing a Table or a Chart on WAD , then you have the option of changing by right click on Table or Chart and click Properties/Edit properties.. here you can change the output color, font, background, width, number of output rows.. etc
    hope this helps,
    Thanks,
    Sudhakar

  • How to filter the output of a query according to the language

    Hi guys,
    I have the following tables joined togheter:  VBAK ,VBKD ,TVZBT.
    The problem is, the output gives any record as many times as many languages exist in table TVZBT
    I tried with the following instruction but it doesn't work,no matter in which event I put it:
    check tvzbt-spras eq sy-langu.
    Thanks,Christian

    Hello Christian Baldari,
    You have to add that check in where clause like :
    select ....
    from ...
    where
    <b>tvzbt~spras eq sy-langu</b>.
    why because in ur select query you are using innerjoin operation. so you are using TILD (~) operator for alias. you have to check the spras using the alias as mentioned above.
    Reward If Hepful.
    Regards
    Sasidhar Reddy Matli.

  • Can we generate the output of SQL Query in XML format ..

    Hi Team,
    Can we generate an XML doc for an SQL Query.
    I've seen in SQL Server 2000.It is generating the output of an SQL Query in xml format.
    select * from emp for xml auto
    The output looks like
    <emp EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="20"/><emp EMPNO="7370" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="10"/>

    Just a little bit of short hand.
    Get the XML out of your database, via HTTP
    Of course the easiest method is just to return an XMLType from a stored procedure and let the calling routine figure out what to do with it. Instead
    of that way though, I'll show you how to do it via HTTP. It's all completely built into 10g and is super easy to use.
    CREATE OR REPLACE VIEW emps_and_depts AS
    SELECT e.employee_id AS "EmployeeId",
    e.last_name AS "Name",
    e.job_id AS "Job",
    e.manager_id AS "Manager",
    e.hire_date AS "HireDate",
    e.salary AS "Salary",
    e.commission_pct AS "Commission",
    XMLFOREST (
    d.department_id AS "DeptNo",
    d.department_name AS "DeptName",
    d.location_id AS "Location"
    ) AS "Dept"
    FROM employees e, departments d
    WHERE e.department_id = d.department_id
    Some people hear web and immediately start salivating about security issues. Let me address that quickly. Just because you have the HTTP and/or
    FTP servers running in the database, that does not mean you have a security problem. For one, I would hope your databases are behind a firewall.
    Second, with the correct architecture (DMZ, app servers, etc) you can make this data available outside the firewall fairly transparently and third,
    just because it's on the web does not mean the data MUST be available on the internet. This is a good way to make your data available on your
    intranet. If you are worried about people INSIDE your firewall, that still doesn't preclude web based access. Follow Oracle security guidelines.
    Before I show you how to get to your data, let's talk about URLs and URIs. A URL is a Uniform Resource Locater and URI is a Uniform Resource
    Identifier. A URL is the way you would identify a document on the net, i.e. http://www.oracle.com is a URL. A URI is a more generic form of a URL.
    Oracle supports three types of URI: HTTPURIType - basically a URL (which would be like the URL above), XDURIType - a pointer to an XDB resource
    (usually an XML document but can be other objects), and DBURIType - a pointer to database objects.
    It's the DBURIType that we're going to concentrate on here. The DBURIType let's us reference database objects using a file/folder paradigm. The
    format for a DBURI is /oradb/<schema>/<table>. Oradb is shorthand for the database; it is not the database name or SID. My database is named XE
    but I still use oradb in the DBURI. For example, the view we created above is in my XE database, is owned by HR (at least in my case) and is called
    EMPS_AND_DEPTS. This can be referenced as /oradb/HR/EMPS_AND_DEPTS.
    If the view had many rows and you wanted only one of them, you can restrict it by including a predicate. The documentation for XDB has a great
    write up on Using DBURIs.In our case, we are going to write out the entire document. Now that you understand that the DBURI is a pointer to
    objects in our instance, we can use that to access the data as a URL.
    The format for the URL call is http://<machinename>:<port>/<DBURI>
    In my case, my XE database is running on a machine called mach1 and is listening on port 8080. So to see the view we created above, I open my
    browser and navigate to: http//mach1:8080/oradb/HR/EMPS_AND_DEPTS
    The created URL will be as http//mach1:8080/oradb/PUBLIC/EMPS_AND_DEPTS
    If your database is set up correctly and listening on port 8080 (the default), your browser should ask you to login. Login as the user who created the
    view (in my case HR). You should now get an XML document displayed in your browser.
    And that's it. It doesn't get much simpler than that. If you get rid of the descriptive text above, it basically comes down to:
    Create a table or view
    Open your web browser
    Enter a URL
    Enter a user ID and password
    View your XML
    If you notice, Oracle formatted the data as XML for us. Our view returns scalar columns and an XML fragment called Dept. Oracle formatted the
    return results into an XML format.
    And as a side note, if you look closely, you'll see that my URL has PUBLIC where I said to put HR. PUBLIC is a synonym for all objects that your
    logged in user can see. That way, if your user has been granted select access on many schemas, you can use PUBLIC and see any of them.

  • Write the output of a query in ODI to file

    Hi Friends,
    I am using ODI 11g.
    In ODI I want to write the output of the below query to a unix file.
    SELECT 'H'|| rpad('SB9KT.KTPRTO.EBSDATA.D0000000','30',' ')|| rpad(to_char(sysdate, 'YYYYMMDDHHMMSS'), 16, ' ')
    FROM dual;
    Please suggest any inputs.
    Thanks,
    Lony

    lony wrote:
    Hi Friends,
    I am using ODI 11g.
    In ODI I want to write the output of the below query to a unix file.
    SELECT 'H'|| rpad('SB9KT.KTPRTO.EBSDATA.D0000000','30',' ')|| rpad(to_char(sysdate, 'YYYYMMDDHHMMSS'), 16, ' ')
    FROM dual;
    Use OdiSqlUnload tool to write the output of the sql query to a file
    Please suggest any inputs.
    Thanks,
    Lony

Maybe you are looking for

  • For report with material and workcenter

    my client reqd a report for the materials plan order and production generate for the period with respective week in specific workcenter. Hence for the plan order order and production order i am useing PLAF and AFPO but i am expecting a excelent tips 

  • How can I get the phone app into the doc

    I moved from an ipod touch, without a phone app.   Now my iphone 5s has a phone app, but how do I get it to be one of the four choices in the dock?

  • A query about SOA Design and development

    Hi Why everybody these days are interested in SOA ?? The question i mean to ask is from a Service User Perspective , arent we coding our Application forcefully in the idea of making use of Other Software ?? Isn't this is a draw back ? (I am asking in

  • Data selection and report generation

    Hi, I want to create a report with information about friends. I have a class like this: public class friend(){ Date born; Vector phones; String name; I have a collection of friends and I want generate a report with some of them. I want to select thos

  • Extracting data from Express to SQL Server

    is there a way to extract data from a Personal Express (v5) database into MS SQL Server (2000) using a DTS package ? I haven't found any references to an Express ODBC driver so I doubt it's possible and I may have to use SNAPI from VB. thanks.