Application of pivot using XML in the APEX option

Hi all..

I am using the following query to pivot

with pivot_data like)
SELECT bdate, cat_code, no_of_ppl, agent_Code FROM test_table
)
Select * from pivot_data
(XML) PIVOT
Sum (no_of_ppl) to (agent_code), IN (select agent_code from tbl_agents)
)
order by bdate;

When I run it using apex SQL Workshop we give the following result

BDATE CAT_CODE AGT_CODE_XML
01/01/2011 4 [data type not supported]
01/01/2011 5 [data type not supported]
01/01/2011 6 [data type not supported]
01/01/2011 7 [data type not supported]

What can b the reason to give the "unsupported data type' instead of the actual values.

Kind regards

AD_PSA

To get APEX to render the XML output must be serialized (default) CLOB or VARCHAR2:

select
          deptno
        , xmlserialize(content job_xml) xml
from
          (select
                    job
                  , deptno
                  , sal
          from
                    emp)
pivot
          xml(sum(sal) for job in (select distinct job from emp))
order by
          deptno;

DEPTNO XML
------ ---
10     ANALYSTCLERK1300ENGINEERMANAGER2450PRESIDENT5000SALESMAN
20     ANALYST6000CLERK1100ENGINEERMANAGER2975PRESIDENTSALESMAN
30     ANALYSTCLERK950ENGINEERMANAGER2850PRESIDENTSALESMAN4100
40     ANALYSTCLERK800ENGINEER1500MANAGERPRESIDENTSALESMAN 

To use it in a report the result of pivot XMLType must be shredded using XMLTABLE to produce additional columns, or transformed into HTML using XSLT then serialized.

Tags: Database

Similar Questions

  • Display of XML in the APEX problems

    Hello.

    Help pls, have an Oracle XE and APEX 4.2.1 when trying to display 1 data sell shema form DB (xmltype) (xml document example - 1116 symbols to sell table DB-) in the report of the APEX (SQL query type), in application Apex data report displayed not fully, as 500 symbols off 1116.

    What is and how to fix it?

    Police says:

    I'll try to explain my problem in detail.

    I create a report > report APEX Classic with 1 column and 1 row to display a 1 query xml data document form sql. These data should be displayed in a cell in report APEX > classic report, but as I mentioned earlier, the data in my cell completely visible, as 500 symbols off 1116.

    Is this clear?

    Not really. I don't know what is meant by "symbols" in an XML context. It would be more useful to see an explanation using standard SQL and XML terms such as rows/columns and documents, elements, tags, attributes. Illustrating the problem with an example on apex.oracle.com, it is usually the most effective way to get help. The report query view can also be useful.

    Note that the maximum size of an APEX report line (including all HTML) is also 32 K. This means that the size of these "symbols" (whatever they are) must be less than 29 bytes each for each of them to fit in a cell in a row, which can call this 'design' in question.

  • Values with the HTML not getting informed when using AJAX in the APEX

    Hello

    I use AJAX to fill some values in a tabular report.

    I have a java script of this form (I took this example Denes http://apex.oracle.com/pls/otn/f?p=31517:241:1400877312570049) example

    < script language = "JavaScript" type = "text/javascript" >

    function f_set_multi_items_tabular (pValue, bow) {}
    get var = new htmldb_Get (null, html_GetElement('pFlowId').value,
    = Set_Multi_Items_Tabular', 0);
    {if (pValue)}
    Get.Add ('TEMPORARY_APPLICATION_ITEM', pValue)
    Get.Add ('T_ROWNUM', Prow)
    } else {}
    Get.Add ('TEMPORARY_APPLICATION_ITEM', 'null')
    }

    gReturn = get.get ('XML');

    {if (gReturn)}
    var l_Count = gReturn.getElementsByTagName("item").length;
    for (var i = 0; i < l_Count; i ++) {}
    var l_Opt_Xml = gReturn.getElementsByTagName ("item");
    var l_ID = l_Opt_Xml.getAttribute ('id');
    var l_El = html_GetElement (l_ID);
    {if (l_Opt_Xml.firstChild)}
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    } else {}
    var l_Value = ";
    }

    {if (l_El)}
    If (l_El.tagName == 'INPUT') {}
    l_El.value = l_Value;
    } Else if (l_El.tagName == 'SPAN' & & l_El.className == 'Raptor') {}
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.ID = l_ID;
    } else {}
    l_El.innerHTML = l_Value;
    }
    }
    }
    }
    get = null;
    }

    < /script >


    And I the process of application as follows
    BEGIN
    OWA_UTIL.mime_header ("text/xml", FALSE);
    HTP.p ('Cache-Control: non-cache');
    HTP.p ('Pragma: non-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ("< body >");
    HTP.prn ("< desc > This XML genericly defines several elements < / desc > '");
    HTP.prn ("< item id =" f05_000 "|: T_ROWNUM |" "> ' |: TEMPORARY_APPLICATION_ITEM |") ("< / item > ');
    HTP.prn ("< / body >");
    END;
    If I have: TEMPORARY_APPLICATION_ITEM as "Vikas" gets it displays correctly, but if I "& lt;" b & gt; Vikas & lt; b & gt;' it shows null. If she tags HTML function l_Opt_Xml.firstChild.nodeValue does not correctly work.
    Please tell me what modiifcation can I use in the l_Opt_Xml.firstChild.nodeValue function to get values with HTML tags also to are displayed.

    Thank you
    Vikas

    Vikas,

    Try to escape special characters:

    htf.escape_sc(:TEMPORARY_APPLICATION_ITEM)
    

    Kind regards
    Dan

  • Configuration of SSL using listener of the APEX on Apache Tomcat 7

    Can someone send me the steps to set up the Configuration of SSL on Apache Tomcat 7?

    I use APEX earpiece and deployed to Apache Tomcat.  I need to get the https protocol active. Thank you

    Please see this document. I think this will help you:

    https://Tomcat.Apache.org/Tomcat-7.0-doc/SSL-HOWTO.html

  • Problem when using Ajax in the APEX.

    Hi all

    I use this function in my application to overcome the & & problem... This is the query

    DECLARE
    l_counter NUMBER;
    l_o_name VARCHAR2 (2000);
    BEGIN
    FOR rec IN (SELECT distinct FASS. ESCAPE_SC (atct_attr_type), FASS. B ESCAPE_SC (atct_attr_type)
    OF t_new
    WHERE atct_atcl_code =: F41_ATCL_ATT_TYPE_REP_CODE)

    LOOP
    -HTP.prn ("< option value ="' | rec.b |) '">' || Rec.a | ("< / option >");
    dbms_output.put_line (' < option value = "" | ") Rec.b | '">' || Rec.a | ("< / option >");
    end loop;
    END;

    It works very well with any questions...
    But I want to show atct_attr_type at the top of case...
    The use of uppercase letters in the above query...

    Thank you
    David...

    What is the problem with using the UPPER function

    HTF. ESCAPE_SC (UPPER (atct_attr_type))

    in the Query(for loop inline cursor) SQL

  • is Motospeak application that I use to get the caller ID?

    I recently got a razor maxx (which I love) and I'll try to find out how to get ALI talked about bluetooth headset.

    In the menu > call settings, there is a calling "ID reading" setting where you can get

    • ring only


    • caller ID then ring


    • caller ID repeat

  • Application of Pivot Oracle regardless of the number of columns

    Hi, I have a requirement to create a view by turning all the related records primary record, regardless of the number of records, but... the LEVELID marked as primary should be the first column from left to right. The order of the columns from left to right after that are not important.

    There may be up to 18 CODES associated with a time-TRIAL, but the amount is variable.

    Thank you for your time.
     create table 
    id_levels 
    (clm varchar2(12),
     code varchar2 (12),
     levelid varchar2 (12));
     
    
     insert into id_levels select '1','15','Primary' from dual;
    insert into id_levels select '1','42','Secondary' from dual;
    insert into id_levels select '1','44','Third' from dual;
    insert into id_levels select '1','41','Secondary' from dual;
    insert into id_levels select '2','3','Primary' from dual;
    insert into id_levels select '2','4','Secondary' from dual;
    insert into id_levels select '3','24','Primary' from dual;
    insert into id_levels select '3','15','Secondary' from dual;
    insert into id_levels select '3','15','Secondary' from dual;
    insert into id_levels select '3','16','Third' from dual;
    insert into id_levels select '4','12','Primary' from dual;
    insert into id_levels select '4','67','Third' from dual; 
    insert into id_levels select '5','13','Primary' from dual;
    insert into id_levels select '5','24','Secondary' from dual;
    insert into id_levels select '5','22','Secondary' from dual;
    I need the following:
    CLM | Code1. Code2. code 3 | code 4 | job.5 | Code6 | Code7. SH8 | Code9 | CODE.10
    1. 15. 42. 44. 41
    2. 3. 4
    3. 24. 15. 15. 16
    4. 12. 67.
    5. 13. 24. 22

    There may be up to 18 CODES associated with a time-TRIAL, but the amount is variable.

    Thus, when 18 codes can be considered fixed, then you can:

    SQL> select * from v$version where rownum=1;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    
    1 row selected.
    
    SQL> select clm
      2  ,      max(case when rn = 1 then cd end) code1
      3  ,      max(case when rn = 2 then cd end) code2
      4  ,      max(case when rn = 3 then cd end) code3
      5  ,      max(case when rn = 4 then cd end) code4
      6  ,      max(case when rn = 5 then cd end) code5
      7  ,      max(case when rn = 6 then cd end) code6
      8  ,      max(case when rn = 7 then cd end) code7
      9  ,      max(case when rn = 8 then cd end) code8
     10  ,      max(case when rn = 9 then cd end) code9
     11  ,      max(case when rn = 10 then cd end) code10
     12  ,      max(case when rn = 11 then cd end) code11
     13  ,      max(case when rn = 12 then cd end) code12
     14  ,      max(case when rn = 13 then cd end) code13
     15  ,      max(case when rn = 14 then cd end) code14
     16  ,      max(case when rn = 15 then cd end) code15
     17  ,      max(case when rn = 16 then cd end) code16
     18  ,      max(case when rn = 17 then cd end) code17
     19  ,      max(case when rn = 18 then cd end) code18
     20  from (
     21  select t.clm
     22  ,      t.code cd
     23  ,      t.levelid
     24  ,      row_number() over (partition by clm order by case when levelid = 'Primary' then 1 else t
    o_number(code) end) rn
     25  from   id_levels t
     26       )
     27  group by clm
     28  order by clm;
    
    CLM          CODE1        CODE2        CODE3        CODE4        CODE5        CODE6        CODE7        CODE8        CODE9
    ------------ ------------ ------------ ------------ ------------ ------------ ------------ ---------
    1            15           41           42           44
    2            3            4
    3            24           15           15           16
    4            12           67
    5            13           22           24
    
    5 rows selected.
    
    SQL> set lines 50
    SQL> /
    
    CLM          CODE1        CODE2
    ------------ ------------ ------------
    CODE3        CODE4        CODE5
    ------------ ------------ ------------
    CODE6        CODE7        CODE8
    ------------ ------------ ------------
    CODE9        CODE10       CODE11
    ------------ ------------ ------------
    CODE12       CODE13       CODE14
    ------------ ------------ ------------
    CODE15       CODE16       CODE17
    ------------ ------------ ------------
    CODE18
    ------------
    ...
    CLM          CODE1        CODE2
    ------------ ------------ ------------
    CODE3        CODE4        CODE5
    ------------ ------------ ------------
    CODE6        CODE7        CODE8
    ------------ ------------ ------------
    CODE9        CODE10       CODE11
    ------------ ------------ ------------
    CODE12       CODE13       CODE14
    ------------ ------------ ------------
    CODE15       CODE16       CODE17
    ------------ ------------ ------------
    CODE18
    ------------
    
    5 rows selected.
    
    SQL> 
    
  • Buttons below the APEX 4.0.2 not generating an html APPLICATION

    ... during the publication of my original text, it seems to have disappeared.

    Anyway, my question has been to apply a button and why I couldn't see it from the process of page "Front of the head" (this also applies to 'Select list with Submit'). If I click on a button that makes a shipment (or choose from a 'select with Submit list'), I can see the request in the page process 'OnSubmit' but not the "OnLoad before head" process page. If I come home "& REQUEST.' in 'DEMAND' field of the unconditional branch of the request is available." I always thought that leaving the field of APPLICATION to empty of unconditional branch the reqest would be routed through default so I can test against it in a process of 'Head before'?

    Another scenario I'm mistaken, is too, when I have a button based on a model that has the code such as:
    < input type = "SUBMIT" value = "" #LABEL # "/ >,"
    I do not all apply? If I change the "input type" button, it works fine.

    THX
    Nigel

    Published by: theArrow on October 31, 2011 05:52

    Published by: theArrow on October 31, 2011 06:05

    theArrow wrote:
    Hi, just tried the code proposed above, but I get an error in my application saying: error ERR-1002 unable to find item for the 'REQUEST' element ID in the "13100" application If I use a javascript with apex.submit button, it passes through this systematic fine.

    I presume that for the SUBMIT type buttons it does not create a: QUERY element.

    I created a page element to: REQUEST and it seems to work.

    What is the right thing to do?

    N °

    Try

    apex_application.g_request := nvl(v('REQUEST'), 'SUBMIT');
    

    Looks like that he doesn't like the shape of link of : ASK in the code in the process.

  • Errors during the demo 'building a Web Application with JDeveloper11g using EJB'

    Hello

    I'm going by the demo of building a Web Application with EJB using JDeveloper11g. The demo lasts great until "Running Java outside of Java EE container Service".

    I followed the steps "That runs the Java Service outside Java EE container" exactly as written:

    1. now, create a new persistence unit to run the java service outside the Java EE container. Right click on the file META-INF. Persistence.XML and select new Service Java façade in the context menu.

    2. in the Java Service façade to create, if necessary, click next to go to the home page. In the class of Service Java Panel, you can choose to create a new persistence unit (in the next panel) or use an existing unit. Select Choose a persistence unit or create one in the next panel and check the generate a checkbox in the main() method.

    3. the name of the persistence on the outside unit. Choose the JDBC connection and make sure that the JDBC connection is set to HRConn.

    4. all methods should be selected by default. Deselect some of them so that your selection looks like the following image. (Remove the 'byRange' methods)

    5. in the source editor window, for the JavaServiceFacade class, add a new line after the / / TODO comment and enter the following statement:

    Employees a = javaServiceFacade.queryEmployeesFindByName("P%").get(0);
    System.out.println (a.getLastName ());

    When I type the code above:
    Employees a = javaServiceFacade.queryEmployeesFindByName("P%").get(0);
    System.out.println (a.getLastName ());

    I get the following errors:

    Create method to "queryEmployeesFindByName".
    Separate declaration and assignment

    Any help is appreciated.

    Kind regards

    Kelly

    If you use this tutorial - the use of building 5407 http://www.oracle.com/technology/obe/obe11jdev/bulldog/ejb_jpa_jsf/ejb.html#t2s4

    Looks like the link to the tutorial page pointed to an older version.

  • can we use DIV instead of tables in the APEX

    Morning friends,

    can we use < div > instead of using tables in the APEX. If so, let me know da procedure. Please make me understand in layman's term, as I just started learing APEX.

    Greetings
    Jean francois

    As I said in the first line of my first post:

    Yes, you can. You must do this in page templates, region or report on shared components of the request of the manufacturer.

    If you look at, you'll see the models and all the table tags HTML. I would say that you copy a model at a time and work with your copy so that you don't the hose upward standard Apex stuff.

    Earl

    Published by: Earil on April 9, 2009 08:57

  • Duration of the apex - can we have access to the "Public Services" link Avaialbe in IDE

    Currently using Apex 3.2-11 GR 2

    The Production Server has only "Apex RUNTIME". All developer access is not allowed.

    But the requirement is a Manager to open a session in the IDE of the Apex and click "Utilities" and click reports Apex in the only case of "Apex runtime" on production. This is necessary for the Manager to see and monitor due to security requirements.

    The "Utilities" option is available during the installation of the apex is "runtime" only mode? Whatever it is dynamically switchable to a specific user connection to allow them to access these reports of object? Other suggestions on how these reports are available directly outside the Apex would also help.

    Thank you!

    citing the book Oracle Application Express 3.2

    When the APEX is first installed, we can choose whether to install the APEX or APEX Runtime Environment complete development environment. This can be changed later by running the SQL scripts provided with the installation of the APEX. We can convert from a development environment complete APEX for an APEX runtime environment by running script SQL apxdevrm.sql that helps the user SYS with SYSDBA role. We can also convert a runtime environment to a full development environment by running SQL apxdvins.sqlscript. Conversion of the environment leave our unchanged applications, and they can be run using the same exact URL.

    Thank you

    Tony Miller

    Software LuvMuffin

  • call the apex of extern with parameter page

    Hello!

    is it possible to call a page of the apex of an external application and pass a parameter to the apex page?

    something like this:
    http://server:7777/apex/f? p = 128:8 & P8_FIELD1 = 12345 & P8_FIELD2 = abcdef

    Thanks in advance.

    Best regards
    Christian

    Hi Christian,

    Standard APEX accepts no additional parameters in the URL to call, but there are ways to work around:

    (1) pass it as part of value (see http://www.oracle-and-apex.com/apex-url-format/ for a description of the Format of the URL). It won't work if you don't have an id of session of the Summit.

    (2) create a procedure public callable that accepts parameters, in this procedure, you define a global package variable and call the procedure of 'f' APEX with all necessary parameters.

    (3) 'flexible' call format use: http://rokitta.blogspot.com/2009/07/apex-fp-syntax-with-flexible-parameter.html

    brgds,
    Peter

    -----
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at
    Training: http://www.click-click.at/apex-4-0-workshops

  • I tried to copy several items which are separate from any application that I use.

    I'm updating (OS X v. 10.11.6) on all the improvements etc. use only the desktop iMac & use most of the time, & Contacts 'Pages', 'Safari '. In addition, I'm a 'ole' jerk who uses 1 finger of each hand type & am very slow; & I'm in a w/Chair with other disabilities, hearing, etc.

    N ° 1: I tried to copy several items which are separate from any application that I use. As the "second word through the fourth word, then somewhere further down in the same app anouther Word or group of words and so on."

    No. 2: I tried to connect you 'communities' and after several hours and a lot of frustration, I tried to get a new one, and that's how I found myself here!

    I would like an answer to #1, if you have any info that I can use. Otherwise, I'll try something new tomorrow.

    Thank you

    Bill C.

    < post branched out by host >

    Hello Warcloud7

    1. Double-click the first word of your desired channel
    2. SHIFT, click after the last word in the string to highlight the word two by four (see screenshot)
    3. COMMAND double click on another FIRST word "later on."
    4. SHIFT-click after the last word you want
    5. COPY however you are comfortable - Edit menu or command + C
    6. switch to some other app that you like
    7. Paste your favorite way

  • How to completely uninstall the APEX?

    Hello

    I want to install and run Jenkins CI on localhost: 8080 but he pointed me still http://localhost: 8080/apex/f? p = 4950:1.

    I uninstalled Oracle 11 g Express Edition and it seemed to go away but the APEX is still on port 8080.

    Any tips?

    Thanks in advance.

    Hi 2938071,

    2938071 wrote:

    Please change your login username of "2938071" to something meaningful. Reference: Video tutorial how to change username available

    I want to install and run Jenkins CI on localhost: 8080 but he pointed me still http://localhost: 8080/apex/f? p = 4950:1.

    I uninstalled Oracle 11 g Express Edition and it seemed to go away but the APEX is still on port 8080.

    If Oracle DB is uninstalled, then it is not possible that APEX will always remain. As APEX Oracle is installed in Oracle DB, Oracle DB uninstallation will certainly remove it as well. Check if your browser renders page caching.

    If it's not the cached page, then check if you have another instance of Oracle DB installed on which runs Oracle APEX.

    There is no need to uninstall Oracle APEX, you use according to the webserver option you can change the port on which runs Oracle APEX.

    If you use Oracle APEX on built-in PL/SQL gateway (EPG), you can change the port by connecting to sqlplus with the SYS user and SYSDBA privileges and by running the following SQL command:

    EXEC DBMS_XDB. SETHTTPPORT (8090);

    Reference: https://docs.oracle.com/cd/E59726_01/install.50/e39144/epg.htm#HTMIG29208

    Also, if you want to uninstall Oracle APEX, you can use the 'apxremov.sql' script to uninstall.

    Reference: https://docs.oracle.com/cd/E59726_01/install.50/e39144/trouble.htm#HTMIG270

    Kind regards

    Kiran

  • Email from the apex

    Hello everyone,

    I've never used mail of the Apex and I was wondering how I can achieve this. I have a form with interactive report that has a field with an email address. What I would do is, when the user clicks on the address field of e-mail on the report page, their own email will pop up with e-mail from shippers like e-mail selected according to the report. For example: when I click on [email protected] on the report page interactive, my email from my computer opens with the TO: [email protected].

    Is this possible? I have no idea where I need start. I know there are a lot of mail Apex that we can use, but I don't know how I can use it. Any advice will be appreciated.

    Thank you

    Hello

    Look at:

    Sending mail with attachment

    Ziut

Maybe you are looking for

  • Keynote export (6.6.2) to PDF errors

    Keynote 6.6.2 MacBook Pro (15-inch, mid-2012) / 2.6 GHz Intel Core i7/16 GB 1600 MHz DDR3/NVIDIA GeForce GT 650 M 1024Mo My keynote file is 20 slides for a long time and when I export to PDF (good) 3 of 20 slides contain errors. Now black is white la

  • Satellite A210 - how to reduce the heating?

    I've had my laptop for a year and it heats up a lot over the past months! I put t know how to reduce heating. It goes up to 90 degrees. Gets the graphics adapter * ed and appears black screen and a few lines on the screen should turn it off. Anyone k

  • Sony Vaio Vista, showing 135 GB 320 GB is used but can't see where

    HI there gentlemen/ladies,. One and a half year back I OPurchased Sony Vaio form the showroom of Sony in UAE UNITED, in brief-320 GB HD and 4 GB of RAM with the 64-bit, the issue is that there is hardly any 2 GB of my own docs. and prog files 10 GB;

  • DVD player broke, how can install windows 7

    I had to update my hard drive on my lap top and re - install Windows 7, but the DVD player is broken and won't install disk, are there other options I could try? As a download on a USB and then install from there - (I have the product key).

  • Decorate the screen

    Hello I want to do my eyes screen attractive as having a dynamic background changes color slowly every few seconds Or something interesting. Is it possible if yes how to achieve the goal. I have the whole screen color; Although my page layout can be