Generate data XML from Ref_cursor...

Thanks for the reply

Published by: 000111 on June 12, 2012 16:41

Published by: 000111 on June 12, 2012 16:42

000111 wrote:
Hello
I'm now in xml... I'm trying to generate XML from a ref_cursor... can someone tell me how I can achieve this?

Does this help start?

create or replace function my_func(ctr number)
return sys_refcursor
as
  l_cur sys_refcursor;
begin
  open l_cur for select * from all_objects where rownum <= ctr ;
  return l_cur;
end;
/

One way to use it is:

select xmltype(my_func(2)) from dual ;

Another way is:

declare
   hnd dbms_xmlgen.ctxhandle;
begin
   hnd := dbms_xmlgen.newcontext(my_func(2));
   dbms_xmlgen.setrowsettag(hnd, 'CURSOR');
   dbms_output.put_line(dbms_xmlgen.getxml(hnd));
end;
/

Tags: Database

Similar Questions

  • B2B Gateway fails to generate data xml for 997

    Hi all

    I am faced with a particular problem with one of my test B2B case, where xml for 997 EDI X 12 file is not generated. The file EDI 997 is get picked up however it will fail to generate the request message. In the report so there will be no errors. When I click on the details link on the page of reports for the 997 message the message of application link is not active and does not redirect to the details of the application pop up message by clicking on it.

    Could someone of you please think why this problem occurs... It worked perfectly in my case of dev...

    Please also suggest if more details could be found in the log files of B2B.


    concerning
    Rakesh

    Your real problem is configuration...

    You must go to the Configuration under Administration tab and section of the page, set "notify functional Inbound" accused of reception and the "receipt functional managed automatically ' to 'true '. Otherwise the message from the Application does not get generated for your 997 s entering.

  • To remove data XML from XML using REGEXP_REPLACE tags

    Hello

    I try to use the SQL REGEXP_REPLACE function on a piece of XML, to remove the actual XML data from the weather. My ultimate goal is to end up with a list separated by commas to names of XML elements. In the first stage, I want to just pull all of the actual data.

    I tested the following query, and it initially appeared to work:
    SELECT REGEXP_REPLACE('&gt;THIS IS A TEST&lt;', 
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;' ) AS test_result
      FROM dual;
    Unfortunately, when I applied it to a full XML string, it did not. Here is the query to test that I used:
    SELECT REGEXP_REPLACE('&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;123&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;THIS IS A TEST!&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;') AS test_result
      FROM dual;
    I found myself with the following result:

    * & lt; LINE & gt; & lt; / LINE & gt; *

    What I was trying to a:

    * & lt; LINE & gt; & lt; TEST_ELEMENT1 & gt; & lt; / TEST_ELEMENT1 & gt; & lt; TEST_ELEMENT2 & gt; & lt; / TEST_ELEMENT2 & gt; & lt; / LINE & gt; *

    If you are reading this and you are a Posix regular expression guru, could you let me know exactly where I am going wrong? Regular expressions are not my strong point, but I would better go home.

    Hello

    For your final requirement, the 'commas list names of XML elements', what using XQuery with something like:

    SELECT xmlquery(
      'string-join( for $i in $d//*
                    return local-name($i), "," )'
      passing xmltype('123THIS IS A TEST!') as "d"
      returning content
    ).getStringVal()
    FROM dual;
    
  • Merge two files of system-jazn-"Data.xml"

    Hello

    I have a system-jazn-"Data.xml" from Apps BI 7.9.6.4 sized * 1291 KB * (having financial, HR, EAM Analytics) Note: a new installation and no changes have been made in safety.

    Now for EAM Analytics, there is a bug and all application roles are not present in the policy store and apply a patch Patch 16321623 which just States copy the new file system-jazn-"Data.xml" to the location of fmwconfig (see ) doc 1548988.1 )
    Problem is that the size of the system-jazn-"Data.xml" is * 342 kb.*

    Looks like both of these system-jazn-"Data.xml" should be merged. (don't know, maybe this 342KO file contains all application roles)
    Need advice here... as for what I'd do here. ?

    Thank you
    Ashish

    See that there is no problem if you replace, just take the backup or rename the existing _old and copy a new. Even when I installed the OBIA on windows machine on top of some OBIEE dummy to generate the folders (biapps) of informatica, dac, RPD, catalogue files metadata then afterwards I got the file from the file 800ko and according to the guidelines of the oracle, I need to replace the one that is generated with OLIVIER on top on OBIEE which is only 320 kb file I simply replaced it na not thorw errors/problems until now. So I m confident enough to replace the file.

    See this link http://docs.oracle.com/cd/E20490_01/bia.7963/e19038/windows_ic.htm#BABDCEGC paragraph 4.17 applying the security policy of the Oracle BI Applications to the BI domain

    If your BI EE deployed with the Oracle's Applications of BI system is different from the BI EE system used to install some Applications of BI from Oracle, you must apply to the security policy of the domain of BI on BI EE system deployed by following the steps below.

    If your BI EE deployed with the Oracle's Applications of BI system is the same as the BI EE system used to install some Applications of BI of Oracle, then the installer of Oracle's Applications of BI performs this configuration automatically.

    To apply the security policy of the Oracle BI Applications to the BI domain:

    Note: Machine is the machine system. B is the deployment machine.

    Stop all processes in the system of BI EE. More precisely:

    the Administration Server

    + (if there is a cluster) all managed servers in the cluster bi_cluster +.

    all processes managed opmn

    On computer B, save and rename the existing DOMAIN_HOME/config/fmwconfig/system-jazn-data.xml.

    For example, if the root folder of BI EE is named OracleBIEE11g, then the folder location of the field (on Windows) can be C:\OracleBIEE11g\user_projects\domains\bifoundation_domain\config\fmwconfig.

    Copy the jazn file Applications of BI of Oracle machine machine B to DOMAIN_HOME/config/fmwconfig A ORACLE_HOME/biapps/admin/provisioning/system-jazn-data.xml.

    Start all processes in the BI EE system for security of Oracle's Applications of BI policy take effect. More precisely:

    the Administration Server

    + (if there is a cluster) all managed servers in the cluster bi_cluster +.

    all processes managed opmn

    It may be useful

  • SQL query to generate nested XML data

    Hello
    I use Oracle 11 g R2 SOE...

    I have two main tables

    COMMERCIALS_PROPERTIES (PK, com_id, com_size, project number, com_type number number number)
    COM_PHOTOS (PK ID number, number com_id FK, content mimetype varchar2, blob)

    Please, note that the following has nothing to do with my problem:
    CONTENT and mimetype columns. In addition, the tables of research: PROJECTS, COM_TYPE

    Apex (Application Express) we can expose a report as a RESTful web service in XML format:

    I use this query to generate the XML 1 feed, but I need to change the query to generate flow XML 2 .

    How is this possible?
     Select
          
    "COM"."COM_ID" as "COM_ID",
    "COM"."COM_SIZE" as "SIZE",
    "PROJECTS"."PROJECT_NAME_EN" as "PROJECT",
    "COM_TYPES"."COM_TYPE" as "COM_TYPE",
    
    'http://fam-erp.com/apex/erp/fateh/'||IMG.ID as "ImgURL"
    
     FROM 
    COM_PHOTOS IMG inner join COMMERCIALS_PROPERTIES "COM"
    on   IMG.COM_ID = COM.COM_ID
    inner join "PROJECTS" "PROJECTS" 
    on "PROJECTS"."PROJECT_ID"="COM"."PROJECT_ID"
    inner join "COM_TYPE_LOOKUP" "COM_TYPES" 
    on "COM_TYPES"."TYPE_ID"="COM"."COM_TYPE"
         
     WHERE
      COM.COM_ID < 80 order by 1
    H1. XML 1
    H2. Please look only < COM_ID > and < ImgURL >
    <ROWSET>
    <ROW>
    <COM_ID>77</COM_ID>
    <SIZE>842</SIZE>
    <PROJECT>Bayswater Tower</PROJECT>
    <COM_TYPE>Office</COM_TYPE>
    <ImgURL>http://fam-erp.com/apex/erp/fateh/1410</ImgURL>
    </ROW>
    
    <ROW>
    <COM_ID>77</COM_ID>
    <SIZE>842</SIZE>
    <PROJECT>Bayswater Tower</PROJECT>
    <COM_TYPE>Office</COM_TYPE>
    <ImgURL>http://fam-erp.com/apex/erp/fateh/1412</ImgURL>
    </ROW>
    
    <ROW>
    <COM_ID>78</COM_ID>
    <SIZE>756</SIZE>
    <PROJECT>Bayswater Tower</PROJECT>
    <COM_TYPE>Office</COM_TYPE>
    <ImgURL>http://fam-erp.com/apex/erp/fateh/1425</ImgURL>
    </ROW>
    
    <ROW>
    <COM_ID>78</COM_ID>
    <SIZE>756</SIZE>
    <PROJECT>Bayswater Tower</PROJECT>
    <COM_TYPE>Office</COM_TYPE>
    <ImgURL>http://fam-erp.com/apex/erp/fateh/1429</ImgURL>
    </ROW>
    
    </ROWSET>
    ---------------------------
    H1. XML 2
    H2. Please look only < COM_ID > and < Images > and < ImgURL >
    <ROWSET>
    <ROW>
    <COM_ID>77</COM_ID>
    <SIZE>842</SIZE>
    <PROJECT>Bayswater Tower</PROJECT>
    <COM_TYPE>Office</COM_TYPE>
    <Images>
          <ImgURL>http://fam-erp.com/apex/erp/fateh/1410</ImgURL>
          <ImgURL>http://fam-erp.com/apex/erp/fateh/1412</ImgURL>
    </Images>
    </ROW>
    
    <ROW>
    <COM_ID>78</COM_ID>
    <SIZE>756</SIZE>
    <PROJECT>Bayswater Tower</PROJECT>
    <COM_TYPE>Office</COM_TYPE>
    <Images>
            <ImgURL>http://fam-erp.com/apex/erp/fateh/1425</ImgURL>
            <ImgURL>http://fam-erp.com/apex/erp/fateh/1429</ImgURL>
    </Images>
    </ROW>
    </ROWSET>
    
     

    Hi, Fateh

    One possible way is to use the XML features to create your XML file.
    Using XML, you can make the IMAGES as a subquery XMLAGG rather than join at the table of the image.

    Here is an example of the use of schema SCOTT:

    SQL> select xmlelement(
      2            "ROWSET"
      3          , xmlagg(
      4               xmlelement(
      5                  "ROW"
      6                , xmlforest(
      7                     d.deptno as "ID"
      8                   , d.dname as "NAME"
      9                   , (
     10                        select xmlagg(
     11                                  xmlelement(
     12                                     "ImgUrl"
     13                                   , 'http://the.server.com/'||e.empno
     14                                  )
     15                                  order by e.empno
     16                               )
     17                          from scott.emp e
     18                         where e.deptno = d.deptno
     19                     ) as "Images"
     20                  )
     21               )
     22               order by d.deptno
     23            )
     24         ) the_xml
     25    from scott.dept d
     26    /* joins to the other tables EXCEPT image table */
     27  /
    
    THE_XML
    --------------------------------------------------------------------------------
    10ACCOUNTINGhttp://the.server
    

    The output is an XMLTYPE column (think of it as a CLOB with addition of feature ;-))
    My SQL * PLUS the output of cuts, but believe me, it's all there.
    Just to show, here is the same example, wrapped in a function XMLSERIALIZE to print the XML file:

    SQL> select xmlserialize(
      2            content
      3            xmlelement(
      4               "ROWSET"
      5             , xmlagg(
      6                  xmlelement(
      7                     "ROW"
      8                   , xmlforest(
      9                        d.deptno as "ID"
     10                      , d.dname as "NAME"
     11                      , (
     12                           select xmlagg(
     13                                     xmlelement(
     14                                        "ImgUrl"
     15                                      , 'http://the.server.com/'||e.empno
     16                                     )
     17                                     order by e.empno
     18                                  )
     19                             from scott.emp e
     20                            where e.deptno = d.deptno
     21                        ) as "Images"
     22                     )
     23                  )
     24                  order by d.deptno
     25               )
     26            )
     27            as varchar2(4000)
     28            indent size=2
     29         ) the_xml
     30    from scott.dept d
     31    /* joins to the other tables EXCEPT image table */
     32  /
    
    THE_XML
    --------------------------------------------------------------------------------
    
      
        10
        ACCOUNTING
        
          http://the.server.com/7782
          http://the.server.com/7839
          http://the.server.com/7934
        
      
      
        20
        RESEARCH
        
          http://the.server.com/7369
          http://the.server.com/7566
          http://the.server.com/7788
          http://the.server.com/7876
          http://the.server.com/7902
        
      
      
        30
        SALES
        
          http://the.server.com/7499
          http://the.server.com/7521
          http://the.server.com/7654
          http://the.server.com/7698
          http://the.server.com/7844
          http://the.server.com/7900
        
      
      
        40
        OPERATIONS
      
    
    

    For a Web service you don't need to print the XML that is returned by the Web service.

    I do not know APEX, so I don't know if APEX supports exposing an already built piece of XML, rather than expose a query result.
    But my guess is that it should do very well if you ask an XMLTYPE data type (i.e. - to use the first of my examples, and not automatically printed.)

    If you do not have APEX to do it this way, then I suggest that you try asking in the APEX forum rather than the SQL forum ;-)

  • Generate particular XML data

    Hello

    I need to generate this XML:

    <? XML version = "1.0" encoding = "utf-8"? >
    < message >
    < pippo id = "30" content = "AMALI" / >
    < id pluto = "14" content = "BBBBBBBBBBBBB" / >
    < receptacle duckling = datetime 'CCC' = "' 10/10 / 2010:11:11:11 ' status ="0"/ >"
    < / messages >

    In this table, only lines with INDICATOR = 0:

    CREATE TABLE TOPOLINO
    (
    NAME VARCHAR2 (20 BYTE),
    IDENTIFICATION NUMBER NOT NULL,
    DATE_TIME DATE,
    CONTENT_MEX CLOB,
    INDICATOR NUMBER
    )

    INDICATOR OF CONTENT DATE_TIME NAME ID ID2
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Pippo | 30. || ABDELLAH | || 0
    Pluto | 14. || BBBBBBBBBBBBB | || 0
    Duckling | || CCC | || 10/10 / 2010:11:11:11 | 0
    Minni | 35. || KKKKKKKKKKKK | || 1



    I'm doing some tests with XMLelements, XMLattributes, XMLconcat but not corrected its results.

    Thank you very much.

    Best regards.

    Published by: city_andre on February 10, 2011 9.29

    Published by: city_andre on February 10, 2011 9.42

    Hello

    Please use the {code} tags to display the formatted text.
    It is explained here: http://forums.oracle.com/forums/help.jspa

    You don't mention ID2 column in the CREATE TABLE statement.
    I guess that in fact, it looks like this? (if not, display the corrected structure)

    SQL> select *
      2  from topolino
      3  ;
    
    NAME                   ID ID2         DATE_TIME   CONTENT_MEX              FLAG
    -------------- ---------- ----------- ----------- ------------------ ----------
    Pippo                  30                         AAAAAAAAAAA                 0
    Pluto                  14                         BBBBBBBBBBBBB               0
    Paperino                  CCC         10/10/2010                              0
    Minni                  35                         KKKKKKKKKKKK                1
    

    With SQL/XML functions, an element name can be dynamic, but it is not directly possible with the attributes.
    Thus, in the query below, I had to hard-code the attribute name "duckling":

    select xmlelement("messages",
             xmlagg(
               case when id is not null then
                 xmlelement(evalname(name),
                   xmlattributes( id as "id",
                                  to_char(content_mex) as "content" )
                 )
               else
                 xmlelement("receptacle",
                   xmlattributes( id2 as "Paperino",
                                  to_char(date_time, 'DD/MM/YYYY HH24:MI:SS') as "datetime",
                                  0 as "status" )
                 )
               end
             )
           )
    from topolino
    where flag = 0
    ;
    

    With XQuery, however, you can generate any expression attribute name:

    with t as (
      select xmltype(
               cursor(
                 select name, id, id2, to_char(date_time,'DD/MM/YYYY HH24:MI:SS') date_time, content_mex
                 from topolino
                 where flag = 0
               )
             ) as doc
      from dual
    )
    select xmlquery(
    '
     {
      for $i in /ROWSET/ROW
      return
        if ($i/ID) then
          element {$i/NAME} { attribute id {$i/ID},
                              attribute content {$i/CONTENT_MEX} }
        else
          element receptacle { attribute {$i/NAME} {$i/ID2},
                               attribute datetime {$i/DATE_TIME},
                               attribute status {0} }
     }
     '
     passing t.doc
     returning content
    )
    from t
    ;
    

    Published by: odie_63 on 10 Feb. 2011 20:37

  • Graphic design of data sourcing XML from a database

    Hi all

    I try to display a histogram with Source such as an XML that is generated from a database using PHP. Some how I get errors... Is it possible to do that... He... If so how should it be done.

    This table exists in MYSQL

    CREATE TABLE "project1". "bubble_graph")
    Varchar (45) 'Product' NOT NULL default ",
    int (10) 'delivery' unsigned zerofill NOT NULL,.
    int (10) unsigned zerofill NOT NULL ' delay'
    ) ENGINE = InnoDB DEFAULT CHARSET = latin1;


    INSERT INTO bubble_graph VALUES ('IteamA', 20, 2);
    INSERT INTO bubble_graph VALUES ('IteamB', 20, 8);
    INSERT INTO bubble_graph VALUES ('IteamC', 20, 1);
    INSERT INTO bubble_graph VALUES ('IteamD', 20, 6);
    INSERT INTO bubble_graph VALUES ('IteamE', 20, 15);
    INSERT INTO bubble_graph VALUES ('IteamF', 20, 3);
    --------------------------------------PHP----------------code
    <? PHP
    Define ("DATABASE_SERVER", "localhost: 3306 ');
    Define ('DATABASE_USERNAME', 'root');
    Define ("DATABASE_PASSWORD", "yyyyyyy");
    Define ('database_name', 'Project1');

    connect to the database
    $mysql = mysql_connect (' localhost: 3306 ', 'root', 'yyyyyy');

    @mysql_select_db (DATABASE_NAME);

    Returns a list of all users
    $Query = ' select Product, round (delivery) as delivery, round (delay) in the time of bubble_graph ";
    $Result = mysql_query ($Query);

    $Return = "< root >."

    While ($User = mysql_fetch_object ($Result))
    {
    $Return. = "< Data > ';
    $Return. = "< data". " Product =------"". " $User-> product. » \ "> » ;
    $Return. = '< product >. $User-> product. "< / product > ';
    $Return. = "< delivery >." $User-> delivery. "< / delivery > ';
    $Return. "< delay > =. $User-> delay. "< / delay > ';
    $Return. = "< / data > ';

    }
    $Return. = "< / root >;
    mysql_free_result ($Result);
    print ($Return)
    ? >
    ++++++++++++++++++++++++++++++Flex code+++++++++++

    < mx:ColumnChart id = "table" dataProvider = "{results}" showDataTips = "true" width = "513" height = "286" type = "grouped" x = "0" y = "31" >
    < mx:horizontalAxis >
    < mx:CategoryAxis dataProvider = "{results}" categoryField = "Product" / >
    < / mx:horizontalAxis >

    < mx:series >
    < mx:Array >
    < mx:ColumnSeries yField = 'period' name = 'time' / >
    < mx:ColumnSeries yField = 'delivery' name = 'delivery' / >
    < / mx:Array >
    < / mx:series >
    < / mx:ColumnChart >


    Consider this, your code is far away. Your idea is fundamentally correct, but take a look at one, I built. This actauly return xml from a database published on a page and access to the page & data using the correct data aggregate query string values. Look closley the code using im to organize the results.


    http://www.Adobe.com/2006/mxml"layout ="absolute"backgroundGradientColors ="[#ffffff, #ffffff]"currentState ="stSalesByDate">


    Import the required namespaces
    Import mx.controls.Alert;
    import mx.validators.DateValidator

    var ResolveUrl:String = "";

    Initialization function manages the init program
    private function init (): void {}

    ResolveUrl = Application.application.parameters.ResolveUrl;

    }

    Valid entries and fires http service
    private function buildReports (): void {}

    var retVal:Boolean = isValidDates (dateStart.text, dateEnd.text);

    If (retVal == true) {}

    wService.send ();
    currentState = "stSalesResults";

    } else {}

    Alert.Show ("Please enter dates valid.', 'Invalid Date', Alert.OK");

    }

    }

    Manages the State switch Events for new reports
    private function newReport (): void {}

    currentState = "stSalesByDate";

    }

    Date comparison function handles to ensure deadlines are valid
    private void isValidDates(strStart:String,_strEnd:String):Boolean {}

    var blnIsValid:Boolean = false;

    If (strStart.length == 0 | strEnd.length == 0) {}

    blnIsValid = false;

    } else {}

    blnIsValid = true;

    }

    return blnIsValid

    }

    ]]>































    This code is called e4x he treats xml as a native object, search :)

  • Generate the xml in a program of Conc via the data model fails...

    Hi all...

    I hope, to a person, as a problem of beginner right front...

    As the title States, Ive created a model of data below...
    <dataTemplate name="UofS_Outstanding_Expenses_Report" description="SUEXPTRK - UofS Outstanding Expenses Report" dataSourceRef="FINTEST" version="1.0">
    <parameters>
    <parameter name="p_claimant" dataType="character" />
    <parameter name="p_expense_date_from" dataType="date" />
    <parameter name="p_expense_date_to" dataType="date" />
    <parameter name="p_raisedby" dataType="character" />
    <parameter name="p_status" dataType="character" />
    </parameters>
    <dataQuery>  
    <sqlStatement name="Q1">
    <![CDATA[
    SELECT erh.invoice_num, pap.full_name Employee_Claiming,
    DECODE(NVL(erh.expense_status_code, 'Not yet Submitted (NULL)'), 'CANCELLED', 'CANCELLED',
         'EMPAPPR', 'Pending Individuals Approval',      'ERROR', 'Pending System Administrator Action',
         'HOLD_PENDING_RECEIPTS     ', 'Hold Pending Receipts', 'INPROGRESS', 'In Progress', 'INVOICED', 'Ready for Payment',
         'MGRAPPR', 'Pending Payables Approval', 'MGRPAYAPPR', 'Ready for Invoicing', 'PAID', 'Paid',
         'PARPAID', 'Partially Paid',     'PAYAPPR', 'Payables Approved',     'PENDMGR', 'Pending Manager Approval',
         'PEND_HOLDS_CLEARANCE', 'Pending Payment Verification',     'REJECTED', 'Rejected',     'RESOLUTN',     'Pending Your Resolution','RETURNED',     'Returned',     'SAVED',     'Saved',     'SUBMITTED',     'Submitted',     'UNUSED',     'UNUSED','WITHDRAWN','Withdrawn',     'Not yet Submitted (NULL)') Expense_Status_Code ,
    erh.report_submitted_date Submit_Date, 
    erh.expense_last_status_date Last_Update,
    erh.override_approver_name ER_Approver,
    fu.description ADMINISTRATOR, 
    erh.total, 
    erh.description  
    FROM
    AP_EXPENSE_REPORT_HEADERS_all erh, 
    per_all_people_f pap, fnd_user fu
    WHERE erh.employee_id = pap.person_id 
    AND fu.user_id = erh.created_by
    AND NVL(erh.expense_status_code, 'Not yet Submitted') NOT IN  ('MGRAPPR', 'INVOICED', 'PAID', 'PARPAID')
    AND pap.full_name = :p_claimant
    AND erh.report_submitted_date BETWEEN (:p_expense_date_from) AND (:p_expense_date_to)
    AND fu.description = :p_raisedby
    AND erh.expense_status_code = :p_status
    ]]>
    </sqlStatement> 
    </dataQuery>
    <dataStructure>
    <group name="G_OUTST_EXPENSES" source="Q1">
    <element name="pap.full_name" value="Claimant" /> 
    <element name="erh.report_submitted_date" value="Submitted_Date_from" /> 
    <element name="erh.report_submitted_date" value="Submitted_Date_to" /> 
    <element name="fu.description" value="iExpenses_Administrator" /> 
    <element name="erh.expense_status_code" value="iExpense_status" /> 
    </group>
    </dataStructure>
    </dataTemplate>
    .. who I am trying to run in a data definition XML Pub.

    But, when I run the program designed to generate the xml was generated all matches the parameters without fields or data anywhere...
    <UOFS_OUTSTANDING_EXPENSES_REPORT>
    <P_CLAIMANT/>
    <P_EXPENSE_DATE_FROM>2009-01-01T00:00:00.000+00:00</P_EXPENSE_DATE_FROM>
    <P_EXPENSE_DATE_TO>2009-02-12T00:00:00.000+00:00</P_EXPENSE_DATE_TO>
    <P_RAISEDBY/>
    <P_STATUS/>
    <LIST_G_OUTST_EXPENSES>
    </LIST_G_OUTST_EXPENSES>
    </UOFS_OUTSTANDING_EXPENSES_REPORT>
    .. No matter what I try to change in the select statement, nothing happens...

    Please can someone offer any assistance...?

    Thanks for looking...

    Steven

    Hello

    Your problem may be:
    AND fu.description =: p_raisedby

    If p_raisedby is null your query returns no data.

    You need:
    AND fu.description = nvl(:p_raisedby,fu.description)

    Kind regards
    Gareth

  • SQL to generate the intervals from date of 6 months each, between two date ranges

    Hi all

    I looked in the forums, if someone uses CREATE_CHUNKS_BY_SQL for dates, but no luck.
    I want to update a table using pieces of dates.
    I need to generate date ranges to divide them by pieces.

    I have a table where I know that max (sales_date) and min (sales_date).
    Lets say max (sales_date): min (sales_date) 01/01/2008: 31/10/2010

    I want to break in intervals of 6 months (180 days) as below:
    chunk_id     start_date     end_date
    --------     ----------     --------
      1          01/01/2008     06/30/2008
      2          01/07/2008     12/31/2008
      3          01/01/2009     06/30/2009
      4          01/07/2009     12/31/2009
      5          01/01/2010     06/30/2010
      6          01/07/2010     10/31/2010
    He didn't exactly finish end of the month. Basically, I need these beaches of dates at apart 180 days.

    I appreciate if someone can throw some ideas on this.

    Thank you
    Raj.

    Hi, Raj,

    Sorry, it is unclear what you are asking.

    To generate a list of dates starting with min_sales_date and including all the 180 days after that up to (but not beyond) max_sales_date:

    WITH     got_params     AS
    (
         SELECT     DATE '2008-01-01'     AS min_sales_date
         ,     DATE '2010-10-31'     AS max_sales_date
         FROM     dual
    )
    SELECT     min_sales_date + (180 * (LEVEL - 1))     AS grp_start_date
    FROM     got_params
    CONNECT BY     LEVEL <= CEIL ( ( (max_sales_date - min_sales_date)
                                    + 1
                           )
                         / 180
                         )
    ;
    

    Output:

    GRP_START_D
    -----------
    01-Jan-2008
    29-Jun-2008
    26-Dec-2008
    24-Jun-2009
    21-Dec-2009
    19-Jun-2010
    

    December 16, 2010 is 180 days after June 19, 2010, but it is not displayed, because is after max_sales_date, which is 31 October 2010.

    I hope this helps you.
    Whenever you have any questions, post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.

  • Generate nested xml data

    I now of tables:
    DEPT 
    
    DEPT_ID    DEPT_NAME      GRP_NAME
    ---------  -------------  ------------------------
    1          Engineering    Research and Development
    2          Tool Design    Research and Development
    
    EMP
    
    EMP_ID      FIRST_NAME    MIDDLE_NAME    LAST_NAME     DEPT_ID    HIRE_DATE       
    ----------  ------------  -------------  ------------  ---------  -----------   
    1           Roberto       Luc            Tamburello    1          1997-12-12      
    2           Rob           (null)         Walters       2          1998-01-05      
    3           Thierry       (null)         D'Hers        2          1998-01-11      
    4           Janice        B.             Galvin        2          2001-01-23      
    
    EMP_TEL
    
    EMP_ID    TEL_ID
    --------  ----------
    1         1
    1         5
    2         2
    3         3
    4         4
    
    TEL
    
    TEL_ID    AREA_CODE    PHONE_NO    EXT     TEL_TYPE_ID     
    --------  -----------  ----------  ------  -------------
    1         111          1111111     111     1
    2         222          2222222     222     1
    3         333          3333333     333     1
    4         444          4444444     444     1
    5         555          5555555     (null)  2
    
    TEL_TYPE
    
    TEL_TYPE_ID    TEL_TYPE_CD
    -------------  -----------
    1              OFFICE
    2              FAX
    3              CELL
    Is there a way to generate under xml in a sql statement?
    <Company>
      <Department>
        <DepartmentName>Engineering</DepartmentName>
        <GroupName>Research and Development</GroupName>
        <Employee>
          <FirstName>Roberto</FirstName>
          <MiddleName>Luc</MiddleName>
          <LastName>Tamburello</LastName>
          <HireDate>1997-12-12</HireDate>
          <Telephone>
            <TelephoneType>OFFICE</TelephoneType>
            <TelephoneNumber>111-111-1111</TelephoneNumber>
            <Extension>111</Extension>
          </Telephone>
          <Telephone>
            <TelephoneType>FAX</TelephoneType>
            <TelephoneNumber>555-555-5555</TelephoneNumber>
          </Telephone>
        </Employee>
      </Department>
      <Department>
        <DepartmentName>Tool Design</DepartmentName>
        <GroupName>Research and Development</GroupName>
        <Employee>
          <FirstName>Rob</FirstName>
          <LastName>Walters</LastName>
          <HireDate>1998-01-05</HireDate>
          <Telephone>
            <TelephoneType>OFFICE</TelephoneType>
            <TelephoneNumber>222-222-2222</TelephoneNumber>
            <Extension>222</Extension>
          </Telephone>
        </Employee>
        <Employee>
          <FirstName>Thierry</FirstName>
          <LastName>D'Hers</LastName>
          <HireDate>1998-01-11</HireDate>
          <Telephone>
            <TelephoneType>OFFICE</TelephoneType>
            <TelephoneNumber>333-333-3333</TelephoneNumber>
            <Extension>333</Extension>
          </Telephone>
        </Employee>
        <Employee>
          <FirstName>Janice</FirstName>
          <MiddleName>B.</MiddleName>
          <LastName>Galvin</LastName>
          <HireDate>2001-01-23</HireDate>
          <Telephone>
            <TelephoneType>OFFICE</TelephoneType>
            <TelephoneNumber>444-444-4444</TelephoneNumber>
            <Extension>444</Extension>
          </Telephone>
        </Employee>
      </Department>
    </Company>

    Is there a way to generate under xml in a sql statement?

    Yes, in this way:

    SQL> select xmlelement("Company",
      2               xmlagg(
      3                  xmlelement("Department",
      4                             xmlforest(dept_name as "DepartmentName",
      5                                       grp_name as "GroupName"
      6                                       ),
      7                             (select xmlagg(
      8                                         xmlelement("Employee",
      9                                                    xmlforest(FIRST_NAME as "FirstName",
     10                                                              MIDDLE_NAME as "MiddleName",
     11                                                              LAST_NAME as "LastName",
     12                                                              to_char(HIRE_DATE,'yyyy-mm-dd') as "HireDate"
     13                                                              ),
     14                                                    (Select xmlagg(
     15                                                              xmlelement("Telephone",
     16                                                                         xmlforest(TEL_TYPE_CD as "TelephoneType",
     17                                                                                   AREA_CODE||'-'||PHONE_NO as "TelephoneNumber",
     18                                                                                   EXT as "Extension"
     19                                                                                   )
     20                                                                         )
     21                                                                   )
     22                                                        from TEL t, TEL_TYPE tt, EMP_TEL et
     23                                                       where t.TEL_TYPE_ID=tt.TEL_TYPE_ID
     24                                                         and et.EMP_ID = e.EMP_ID
     25                                                         and et.TEL_ID = t.TEL_ID
     26                                                    )
     27                                                   )
     28                                              )
     29                                from emp e
     30                               where e.DEPT_ID=d.DEPT_ID
     31                              )
     32                             )
     33                      )
     34                    ).extract('/*') doc
     35    from DEPT d;
    
    DOC
    ----------------------------------------------------------------------------------------------------
    
      
        Engineering
        Research and Development
        
          Roberto
          Luc
          Tamburello
          1997-12-12
          
            OFFICE
            111-1111111
            111
          
          
            FAX
            555-5555555
          
        
      
      
        Tool Design
        Research and Development
        
          Rob
          Walters
          1998-01-05
          
            OFFICE
            222-2222222
            222
          
        
        
          Thierry
          D'Hers
          1998-01-11
          
            OFFICE
            333-3333333
            333
          
        
        
          Janice
          B.
          Galvin
          2001-01-23
          
            OFFICE
            444-4444444
            444
          
        
      
    
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]

  • Extending from weblogic security roles (groups) to jazn-"Data.xml" using SQLAuth...

    Hello
    as the title suggests is that I want to do...

    The problem I encounter is that I can't map my Weblogic roles at a level of demand - roles.
    I do not see my weblogic on jazn-"Data.xml" roles and I can't create groups to the application level because
    everything works as SQLAuthenticator on Weblogic...
    I can get the role of user with EL as #{securityContext.userInRole ['ROLE']} but it cannot apply to jazn-"Data.xml".

    Hope that if anyone can help...
    Thank you
    Renan.

    PS: Jdev Studio Edition Version 11.1.1.1.0
    JPA/EJB/ADF app

    Published by: RenanMC on 12/09/2009 09:13

    Hello

    you create groups of jazn-"Data.xml" and then use the weblogic.xml file to map these business groups for groups returned by the SQLAuthenticator

    Frank

  • Generation of the XML from the Oracle tables

    I'm using Oracle 11 g R1.

    I have two tables header and the line:

    CREATE THE TABLE HEADER
    (
    EXPENSE_INFO VARCHAR2 (2000).
    NUMBER OF ERROR_CODE,
    REASON_OF_FAILURE VARCHAR2 (4000)
    )
    /


    CREATE THE ROW IN THE TABLE
    (
    EXPENSE_INFO VARCHAR2 (2000).
    DATE OF EXPENSE_DATE,
    EXPENSE_CODE VARCHAR2 (10),
    EXPENSE_REF VARCHAR2 (2000).
    GROSS_AMOUNT NUMBER,
    NUMBER OF TAX_AMOUNT,
    NUMBER OF ERROR_CODE,
    REASON_OF_FAILURE VARCHAR2 (4000)
    )
    /

    These tables are linked by the EXPENSE_INFO column.

    Complete the tables with the following data:

    Insert in the header (ErrorCode, EXPENSE_INFO, REASON_OF_FAILURE)
    values ('A', 0, 'SUCCESS');

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('A', to_date (December 14, 2012 ', 'dd-mm-yyyy'), 'ABC', 'HOTEL', 100, 500, 0, 'SUCCESS');

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('A', to_date (December 14, 2012 ', 'dd-mm-yyyy'), 'DEF', 'MOVIE', 10, 50, 1, "Cost Code does not exist.");

    Insert in the header (ErrorCode, EXPENSE_INFO, REASON_OF_FAILURE)
    values ('B', 1, "Emp Id does not exist.");

    Insert (EXPENSE_INFO, EXPENSE_DATE, EXPENSE_CODE, EXPENSE_REF, GROSS_AMOUNT, TAX_AMOUNT, ERROR_CODE, REASON_OF_FAILURE) online
    values ('B', to_date (December 14, 2012 ', 'dd-mm-yyyy'), "XYZ", "MILEAGE", 200, 300, 0, 'SUCCESS');



    I want to generate the XML following these tables:


    COSTS of <>
    < EXPENSE_DETAILS >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < EXPENSE_LINES >
    < EXPENSE_LINE_REC >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    ABC of < EXPENSE_CODE > < / EXPENSE_CODE >
    HOTEL < EXPENSE_REF > < / EXPENSE_REF >
    < GROSS_AMOUNT > 100 < / GROSS_AMOUNT >
    < > 500 TAX_AMOUNT < / TAX_AMOUNT >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < EXPENSE_LINE_REC >
    < EXPENSE_INFO > is < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    DEF < EXPENSE_CODE > < / EXPENSE_CODE >
    FILM of < EXPENSE_REF > < / EXPENSE_REF >
    < GROSS_AMOUNT > 10 < / GROSS_AMOUNT >
    < TAX_AMOUNT > 50 < / TAX_AMOUNT >
    < ERROR_CODE > 1 < / ERROR_CODE >
    < REASON_OF_FAILURE > fresh Code does not exist. < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < / EXPENSE_LINES >
    < / EXPENSE_DETAILS >
    < EXPENSE_DETAILS >
    B < EXPENSE_INFO > < / EXPENSE_INFO >
    < ERROR_CODE > 1 < / ERROR_CODE >
    < REASON_OF_FAILURE > Employee Id does not exist. < / REASON_OF_FAILURE >
    < EXPENSE_LINES >
    < EXPENSE_LINE_REC >
    B < EXPENSE_INFO > < / EXPENSE_INFO >
    < EXPENSE_DATE > 14/12/2012 00:00:00 < / EXPENSE_DATE >
    XYZ < EXPENSE_CODE > < / EXPENSE_CODE >
    POINT MILE < EXPENSE_REF > < / EXPENSE_REF >
    < > 200 GROSS_AMOUNT < / GROSS_AMOUNT >
    < > 300 TAX_AMOUNT < / TAX_AMOUNT >
    < ERROR_CODE > 0 < / ERROR_CODE >
    SUCCESS of < REASON_OF_FAILURE > < / REASON_OF_FAILURE >
    < / EXPENSE_LINE_REC >
    < / EXPENSE_LINES >
    < / EXPENSE_DETAILS >
    < / SPENDING >


    I'm not able to generate the XML file. Kindly help me.

    Kind regards
    Sudhanshu

    I love working at the deepest level and then "wrap" with external level tags.

    You want to list all columns of each LINE by line. XMLFOREST is good for this:

    select xmlforest(
      expense_info, expense_date, expense_code, expense_ref,
      gross_amount, tax_amount, error_code, reason_of_failure
    )
    from line;
    
    A
    2012-12-14
    ABC
    HOTEL
    100
    500
    0
    SUCCESS
    ...
    

    Now you want to wrap this up in EXPENSE_LINE_REC

    select xmlelement("EXPENSE_LINE_REC",
      xmlforest(
        expense_info, expense_date, expense_code, expense_ref,
        gross_amount, tax_amount, error_code, reason_of_failure
      )
    )
    from line;
    
    
      A
      2012-12-14
      ABC
      HOTEL
      100
      500
      0
      SUCCESS
    
    

    So far, you have a XML fragment by line in the table of the LINE. You can use XMLAGG to put those together in a single fragment - or rather, a fragment by EXPENSE_INFO.

    Then you use XMLELEMENT again to give the name "EXPENSE_LINES" in this fragment.

    Then you gather the header values and the 'EXPENSE_LINES' fragment in "EXPENSE_DETAILS". This gives you all the information for each row header and associated lines of the LINE.

    Then, you gather all the information into one with XMLAGG header, and give everything a name with XMLELEMENT

    select xmlelement("EXPENSES",
      xmlagg(
        xmlelement("EXPENSE_DETAILS",
          xmlforest(expense_info, a.error_code, a.reason_of_failure),
          xmlelement("EXPENSE_LINES",
            xmlagg(
              xmlelement("EXPENSE_LINE_REC",
                xmlforest(
                  b.expense_date, b.expense_code, b.expense_ref,
                  b.gross_amount, b.tax_amount, b.error_code, b.reason_of_failure
                )
              )
            )
          )
        )
      )
    )
    from header a join line b using(expense_info)
    group by expense_info, a.error_code, a.reason_of_failure;
    

    _Note: _ with the GROUP BY clause, you can 'total' twice, once at the expense_info level and then overall. That's what I do with the two XMLAGGs: the second he puts just all the different stuff EXPENSE_DETAILS together in one package that I wrap "CHARGES" tag autour.

    Also, I omit EXPENSE_INFO of each LINE as it is already in the header information.

    Published by: stew Ashton on December 17, 2012 14:03

  • Generate the XML for double

    Hey gurus,

    I am trying to generate the XML code next to the double, however, I get an error message indicating that my higher level is not set. Any ideas? Thank you!

    < PUDOOUTPUT >
    < PKG >
    < > 12345 SHIPMENTID < / SHIPMENTID >
    < ERROR > 'NO DATA' < / ERROR >
    < ERRORTEXT > "" error: could not find alias sender in SPL_SHIPPER_ACCOUNTS. "< / ERRORTEXT >"
    < / PKG >
    < / PUDOOUTPUT >



    Select xmlelement ("PUDOOUTPUT", xmlelement ("PKG", xmlelement("SHIPMENTID",i.shipmentid),
    XmlElement ("ERROR", "NO DATA")
    XmlElement ("ERRORTEXT", "error: could not find the sender aliases in SPL_SHIPPER_ACCOUNTS.'")))
    in p_wms_output
    Double;

    It works on 10.2.0.3

    select xmlelement("PUDOOUTPUT",xmlelement("PKG",xmlelement("SHIPMENTID",123456),
    xmlelement("ERROR",'NO DATA'),
    xmlelement("ERRORTEXT",'Error: Cannot find shipper alias in SPL_SHIPPER_ACCOUNTS.')))
    from dual;
    

    I suspect the question is because you have "i.shipmentid" in your SQL statement you have to table with an alias of 'I' in your SQL statement. Do you mean something like l_shipmentid as a variable from your PL/SQL code?

  • Generate an equation from a graph XY

    Hello

    Does anyone know how to generate an equation from a graph XY. I had a set of data, generated a parcel interpolated the data set, and my model/curve is logarithmic. Although I would like to get the equation of the curve, the news, I'm really after are the slope and bias from the equation. This is the format I think that equation would be: y = (Slope) * ln (x) + Bias. Any help is greatly appreciated. Thanks in advance.

    You try to run a journal able to Y = ln (x) m + c is no different to running an adjustment linear y = m x' + c, where x' = ln (x).

    Yet, you can do it two ways:

    Logarithm correspond to a sequence of X and will return amplitude and scale.

    Consider a Y ln (bx). We know by simple logarithms ln (bx) can turn in ln (b) + ln (x)

    If Y = a (ln (b) + ln (x))

    Reorganization, ln (x) Y = a + a (b) ln (equivalent to your expression of the slope and bias)

    where a is equal to "amplitude" and b is equal to "scale".

    Linear adjustment of a sequence of X = ln (x) returns the slope and intersection.

    Consider Y = m ln (x) + c = m X + c

    The output of slope m, the point of intersection c.

  • Read xml from url

    Hi all

    I'm trying to get the data from this particular url: http://api.openweathermap.org/data/2.5/weather?q=London&mode=xml

    I have no problem to scan directly from a .xml or xml string. But I can't read the data directly from labview or even save the file in the url as a .xml.

    I already looked for example as reading and other http Web site, but has failed to adapt to my url.

    If someone of you can help me

    Thank you

    The two of them seem to work here in LV 2011 very well:

    Note that the other will require adding support for Datasocket if you build an installer and that the client HTTP screws have been added only around 2011.

Maybe you are looking for

  • Camileo P30 Jpg corruption?

    Camera seems to work very well, but I connect it to my windows 7 PC and download the fixed images (high resolution) and can see the thumbnails in Win7. I click on any one of them and get different error messages that the software package that I try t

  • Driver or Toolbox component missing daqmx.rc

    I'm trying to open a VI works fine on another PC.  At the end of loading, pop ups window "Load and Save WARNING list": Type of warning - missing driver or component Toolbox Details - C:\Program NIUninstaller Instruments\LabVIEW 2011\vi.lib\DAQmx\crea

  • HP Pavilion dv6-3180ea max memory

    I have a HP Pavilion dv6-3180ea http://support.HP.com/us-en/document/c02540088 On the product page plug he says that he does support up to 8 GB of DDR3 memory. Is it true or is it possible to mt to stick 16 GB in there? I've seen other reviews saying

  • How do you burn one cd to another? Using windows xp.

    How to burn one cd to another...

  • How to restore a Windows 7 computer to a previous Windows installation?

    Original title: Reinstall xp Here 2 reinstall xp. I upgraded 2 victory. 7 n want 2 return xp 2.  can any1 help please.