Xml query help

I have the XML below stored in a table in an XML field. I wish to query this record for the <HISTORY_BLOCK> data and get on record for each <row>. ie. I want to do something like
Select
     extractvalue(detail, '/S12/HISTORY_BLOCK/RESULT’),
     extractvalue(detail, '/S12/HISTORY_BLOCK/ACTION’),
     extractvalue(detail, '/S12/HISTORY_BLOCK/DEVICE_TYPE’),
     extractvalue(detail, '/S12/HISTORY_BLOCK/RECORD_NUMBER’)
FROM
     extract(table.field, '/S12/HISTORY_BLOCK’)
which returns multiple records, one for each row. ie.
TIME OUT,DISABLE,TASL,1,TASL,015F,2
NOT SUCCESSFUL,DISABLE,TASL,1,TASL,015D,4
NOT SUCCESSFUL,DISABLE,TASL,1,TASL,015C,6
NOT SUCCESSFUL,DISABLE,ENDOFCAV,1,TASL,0157,8
NOT SUCCESSFUL,DISABLE,ENDOFCAV,1,TASL,0155,10
NOT SUCCESSFUL,DISABLE,ENDOFCAV,1,TASL,0154,12
NOT SUCCESSFUL,DISABLE,TASL,1,TASL,0153,14
NOT SUCCESSFUL,DISABLE,TASL,1,TASL,0152,16
TIME OUT,DISABLE,TASL,1,TASL,0151,18
NOT SUCCESSFUL,DISABLE,TASL,1,TASL,0150,20
Reading the "Oracle9i Application Developer’s Guide - Fundamentals" manual, Table Functions, you can use a PL-SQL Table Function to transform the data and return multiple records from a single record in. As my XML data structure is not set but has many formats, I will need many PL-SQL functions to get the data out.
Can you please check the Oracle resources to see whether there is a straight SQL answer to my requirements.
Example of a single record of XML stored in the detail field.
<S12>
<ID_>ssapp010101125903468218634000</ID_>
<oracle_tzr>EST</oracle_tzr>
<HEADER_DATE_TIME>2005-09-05 16:59:06</HEADER_DATE_TIME>
<NODE>EXEU</NODE>
<EXCHANGE_STATUS>L705AA_64*W</EXCHANGE_STATUS>
<RRN_NUMBER>00052</RRN_NUMBER>
<COMMAND_NAME/>
<MAIN_EXECUTION_RESULT>SYSTEM REPORT</MAIN_EXECUTION_RESULT>
<COMMAND_CODE>AUDIT DISABLE</COMMAND_CODE>
<REPORT_HEADER>REPORT ON DEPENDENT SBLS</REPORT_HEADER>
<NETWORK_ADDRESS>H&apos;0150</NETWORK_ADDRESS>
<SECURITY_BLOCK_TYPE>ACSW</SECURITY_BLOCK_TYPE>
<SECURITY_BLOCK_NUMBER_RANGE>1</SECURITY_BLOCK_NUMBER_RANGE>
<WAIT_FOR_TRAFFIC_CLEAR>0</WAIT_FOR_TRAFFIC_CLEAR>
<GLOBAL_RESULT>ACTION FAILED</GLOBAL_RESULT>
<HISTORY_BLOCK>
<row>
<RESULT>TIME OUT</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>015F</NETWORK_ADDRESS>
<RECORD_NUMBER>2</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>015D</NETWORK_ADDRESS>
<RECORD_NUMBER>4</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>015C</NETWORK_ADDRESS>
<RECORD_NUMBER>6</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>ENDOFCAV</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0157</NETWORK_ADDRESS>
<RECORD_NUMBER>8</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>ENDOFCAV</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0155</NETWORK_ADDRESS>
<RECORD_NUMBER>10</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>ENDOFCAV</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0154</NETWORK_ADDRESS>
<RECORD_NUMBER>12</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0153</NETWORK_ADDRESS>
<RECORD_NUMBER>14</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0152</NETWORK_ADDRESS>
<RECORD_NUMBER>16</RECORD_NUMBER>
</row>
<row>
<RESULT>TIME OUT</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0151</NETWORK_ADDRESS>
<RECORD_NUMBER>18</RECORD_NUMBER>
</row>
<row>
<RESULT>NOT SUCCESSFUL</RESULT>
<ACTION>DISABLE</ACTION>
<DEVICE_TYPE>TASL</DEVICE_TYPE>
<NBR>1</NBR>
<SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
<NETWORK_ADDRESS>0150</NETWORK_ADDRESS>
<RECORD_NUMBER>20</RECORD_NUMBER>
</row>
</HISTORY_BLOCK>
<SECURITY_BLOCKS>

Aussie_boy, there was a slight problem with the xml instance you posted, so i have taken the content only for the history blocks of your interest to make this sample.
you can do it very well what you want using a combination of TABLE,XMLSEQUENCE and EXTRACT functions.
SQL> create table xml_table(id number, xml_data xmltype)
  2  /
Table created.
SQL> insert into xml_table values(1,
  2  xmltype('<HISTORY_BLOCK>
  3   <row>
  4    <RESULT>TIME OUT</RESULT>
  5    <ACTION>DISABLE</ACTION>
  6    <DEVICE_TYPE>TASL</DEVICE_TYPE>
  7    <NBR>1</NBR>
  8    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
  9    <NETWORK_ADDRESS>015F</NETWORK_ADDRESS>
10    <RECORD_NUMBER>2</RECORD_NUMBER>
11   </row>
12   <row>
13    <RESULT>NOT SUCCESSFUL</RESULT>
14    <ACTION>DISABLE</ACTION>
15    <DEVICE_TYPE>TASL</DEVICE_TYPE>
16    <NBR>1</NBR>
17    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
18    <NETWORK_ADDRESS>015D</NETWORK_ADDRESS>
19    <RECORD_NUMBER>4</RECORD_NUMBER>
20   </row>
21   <row>
22    <RESULT>NOT SUCCESSFUL</RESULT>
23    <ACTION>DISABLE</ACTION>
24    <DEVICE_TYPE>TASL</DEVICE_TYPE>
25    <NBR>1</NBR>
26    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
27    <NETWORK_ADDRESS>015C</NETWORK_ADDRESS>
28    <RECORD_NUMBER>6</RECORD_NUMBER>
29   </row>
30   <row>
31    <RESULT>NOT SUCCESSFUL</RESULT>
32    <ACTION>DISABLE</ACTION>
33    <DEVICE_TYPE>ENDOFCAV</DEVICE_TYPE>
34    <NBR>1</NBR>
35    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
36    <NETWORK_ADDRESS>0157</NETWORK_ADDRESS>
37    <RECORD_NUMBER>8</RECORD_NUMBER>
38   </row>
39   <row>
40    <RESULT>NOT SUCCESSFUL</RESULT>
41    <ACTION>DISABLE</ACTION>
42    <DEVICE_TYPE>ENDOFCAV</DEVICE_TYPE>
43    <NBR>1</NBR>
44    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
45    <NETWORK_ADDRESS>0155</NETWORK_ADDRESS>
46    <RECORD_NUMBER>10</RECORD_NUMBER>
47   </row>
48   <row>
49    <RESULT>NOT SUCCESSFUL</RESULT>
50    <ACTION>DISABLE</ACTION>
51    <DEVICE_TYPE>ENDOFCAV</DEVICE_TYPE>
52    <NBR>1</NBR>
53    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
54    <NETWORK_ADDRESS>0154</NETWORK_ADDRESS>
55    <RECORD_NUMBER>12</RECORD_NUMBER>
56   </row>
57   <row>
58    <RESULT>NOT SUCCESSFUL</RESULT>
59    <ACTION>DISABLE</ACTION>
60    <DEVICE_TYPE>TASL</DEVICE_TYPE>
61    <NBR>1</NBR>
62    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
63    <NETWORK_ADDRESS>0153</NETWORK_ADDRESS>
64    <RECORD_NUMBER>14</RECORD_NUMBER>
65   </row>
66   <row>
67    <RESULT>NOT SUCCESSFUL</RESULT>
68    <ACTION>DISABLE</ACTION>
69    <DEVICE_TYPE>TASL</DEVICE_TYPE>
70    <NBR>1</NBR>
71    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
72    <NETWORK_ADDRESS>0152</NETWORK_ADDRESS>
73    <RECORD_NUMBER>16</RECORD_NUMBER>
74   </row>
75   <row>
76    <RESULT>TIME OUT</RESULT>
77    <ACTION>DISABLE</ACTION>
78    <DEVICE_TYPE>TASL</DEVICE_TYPE>
79    <NBR>1</NBR>
80    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
81    <NETWORK_ADDRESS>0151</NETWORK_ADDRESS>
82    <RECORD_NUMBER>18</RECORD_NUMBER>
83   </row>
84   <row>
85    <RESULT>NOT SUCCESSFUL</RESULT>
86    <ACTION>DISABLE</ACTION>
87    <DEVICE_TYPE>TASL</DEVICE_TYPE>
88    <NBR>1</NBR>
89    <SECURITY_BLOCK_TYPE>TASL</SECURITY_BLOCK_TYPE>
90    <NETWORK_ADDRESS>0150</NETWORK_ADDRESS>
91    <RECORD_NUMBER>20</RECORD_NUMBER>
92   </row>
93  </HISTORY_BLOCK>'))
94  /
1 row created.
SQL>
SQL> set linesize 200
SQL> column result format a20
SQL> column action format a10
SQL> column device_type format a10
SQL> column nbr format a5
SQL> column security_block format a20
SQL> column network_address format a10
SQL> column record_number format a20
SQL>
SQL> select extractvalue(value(a), '/row/RESULT')          result
  2       , extractvalue(value(a), '/row/ACTION')          action
  3       , extractvalue(value(a), '/row/DEVICE_TYPE')     device_type
  4       , extractvalue(value(a), '/row/NBR')             nbr
  5       , extractvalue(value(a), '/row/SECURITY_BLOCK')  security_block
  6       , extractvalue(value(a), '/row/NETWORK_ADDRESS') network_address
  7       , extractvalue(value(a), '/row/RECORD_NUMBER')   record_number
  8  from xml_table
  9  , table(xmlsequence(extract(xml_Data, 'HISTORY_BLOCK/row')))  a
10  where id =1
11  /
RESULT               ACTION     DEVICE_TYP NBR   SECURITY_BLOCK       NETWORK_AD RECORD_NUMBER                                                                                                         
TIME OUT             DISABLE    TASL       1                          015F       2                                                                                                                     
NOT SUCCESSFUL       DISABLE    TASL       1                          015D       4                                                                                                                     
NOT SUCCESSFUL       DISABLE    TASL       1                          015C       6                                                                                                                     
NOT SUCCESSFUL       DISABLE    ENDOFCAV   1                          0157       8                                                                                                                     
NOT SUCCESSFUL       DISABLE    ENDOFCAV   1                          0155       10                                                                                                                    
NOT SUCCESSFUL       DISABLE    ENDOFCAV   1                          0154       12                                                                                                                    
NOT SUCCESSFUL       DISABLE    TASL       1                          0153       14                                                                                                                    
NOT SUCCESSFUL       DISABLE    TASL       1                          0152       16                                                                                                                    
TIME OUT             DISABLE    TASL       1                          0151       18                                                                                                                    
NOT SUCCESSFUL       DISABLE    TASL       1                          0150       20                                                                                                                    
10 rows selected.

Similar Messages

  • XML Query Help row with no data

    declare @address table
    AddressID int,
    AddressType varchar(12),
    Address1 varchar(20),
    Address2 varchar(20),
    City varchar(25),
    AgentID int
    insert into @address 
    select 1, 'Home', 'abc', 'xyz road', 'RJ', 1 union all
    select 2, 'Office', 'temp', 'ppp road', 'RJ', 1 union all
    select 3, 'Home', 'xxx', 'aaa road', 'NY', 2 union all
    select 4, 'Office', 'ccc', 'oli Com', 'CL', 2 union all
    select 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 union all
    select 6, 'Home', 'ttt', 'loik road', 'NY', 3
    SELECT a.* from @address a 
    where a.AddressID = 1
    FOR XML path('Addresses')
    SELECT a.* from @address a 
    where a.AddressID = 9
    FOR XML path('Addresses')
    Issue:
    As you can see for second query where AddressID = 9 is not exists so xml is not generated but
    my expected result is for second query is
    <Addresses>
    <AddressID />
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    Thanks in advance for all your help. 

    First of all: Your expectation is wrong. Sorry to say that. But your SQL statement for A.AddressID = 9 does not return a row. So no row is converted. I hope you C it: void.
    From the XML viewpoint:
    <Addresses>
    <AddressID />
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    is equivalent to
    <Addresses />
    which is equivalent to
    void
    You C. Sorry got infeCted some how ;)
    The only meaningful result in XML would be:
    <Addresses ID="1">
    <AddressType>Home</AddressType>
    <Address1>abc</Address1>
    <Address2>xyz road</Address2>
    <City>RJ</City>
    <AgentID>1</AgentID>
    </Addresses>
    <Addresses ID="9"/>
    Cause now Addresses (Really? A plural form for a single entity?) transports the meaning, well there is no data (no row) for it. We tried to find it, but we failed. In opposite to
    <Addresses>
    <AddressID>9</AddressID>
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    <Addresses ID="9">
    <AddressType />
    <Address1 />
    <Address2 />
    <City />
    <AgentID />
    </Addresses>
    Which says: well, we have a row with the ID 9, but the rest of the columns is empty.
    The problem is mere semantics. But it's an important difference.
    Now for your problem: Why do you expect this? Where do can you work with such a kind of informationless result?
    btw, as you're using already a table variable (+1), you should also use
    table value constructors like
    INSERT INTO @address
    VALUES ( 1, 'Home', 'abc', 'xyz road', 'RJ', 1 ),
    ( 2, 'Office', 'temp', 'ppp road', 'RJ', 1 ),
    ( 3, 'Home', 'xxx', 'aaa road', 'NY', 2 ),
    ( 4, 'Office', 'ccc', 'oli Com', 'CL', 2 ),
    ( 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 ),
    ( 6, 'Home', 'ttt', 'loik road', 'NY', 3 );
    I would use a tally table, when you really need this:
    DECLARE @address TABLE
    AddressID INT ,
    AddressType VARCHAR(12) ,
    Address1 VARCHAR(20) ,
    Address2 VARCHAR(20) ,
    City VARCHAR(25) ,
    AgentID INT
    INSERT INTO @address
    VALUES ( 1, 'Home', 'abc', 'xyz road', 'RJ', 1 ),
    ( 2, 'Office', 'temp', 'ppp road', 'RJ', 1 ),
    ( 3, 'Home', 'xxx', 'aaa road', 'NY', 2 ),
    ( 4, 'Office', 'ccc', 'oli Com', 'CL', 2 ),
    ( 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 ),
    ( 6, 'Home', 'ttt', 'loik road', 'NY', 3 );
    WITH n1
    AS ( SELECT *
    FROM ( VALUES ( 1), ( 1), ( 1), ( 1) ) Q ( n )
    n2
    AS ( SELECT a.n
    FROM n1 a ,
    n1 b ,
    n1 c ,
    n1 d
    NumberTally
    AS ( SELECT ROW_NUMBER() OVER ( ORDER BY n ) AS n
    FROM n2
    SELECT NT.n AS [@ID] ,
    a.AddressType ,
    a.Address1 ,
    a.Address2 ,
    a.City ,
    a.AgentID
    FROM NumberTally NT
    LEFT JOIN @address a ON a.AddressID = NT.n
    WHERE NT.n IN ( 1, 9 )
    FOR XML PATH('Address');
    or the void version:
    DECLARE @address TABLE
    AddressID INT ,
    AddressType VARCHAR(12) ,
    Address1 VARCHAR(20) ,
    Address2 VARCHAR(20) ,
    City VARCHAR(25) ,
    AgentID INT
    INSERT INTO @address
    VALUES ( 1, 'Home', 'abc', 'xyz road', 'RJ', 1 ),
    ( 2, 'Office', 'temp', 'ppp road', 'RJ', 1 ),
    ( 3, 'Home', 'xxx', 'aaa road', 'NY', 2 ),
    ( 4, 'Office', 'ccc', 'oli Com', 'CL', 2 ),
    ( 5, 'Temp', 'eee', 'olkiu road', 'CL', 2 ),
    ( 6, 'Home', 'ttt', 'loik road', 'NY', 3 );
    WITH n1
    AS ( SELECT *
    FROM ( VALUES ( 1), ( 1), ( 1), ( 1) ) Q ( n )
    n2
    AS ( SELECT a.n
    FROM n1 a ,
    n1 b ,
    n1 c ,
    n1 d
    NumberTally
    AS ( SELECT ROW_NUMBER() OVER ( ORDER BY n ) AS n
    FROM n2
    SELECT a.AddressID AS [@ID] ,
    a.AddressType ,
    a.Address1 ,
    a.Address2 ,
    a.City ,
    a.AgentID
    FROM NumberTally NT
    LEFT JOIN @address a ON a.AddressID = NT.n
    WHERE NT.n IN ( 1, 9 )
    FOR XML PATH('Address');

  • SQL XML Query Help

    I have four tables and I want to create one XML file. I provided the temp tables with
    data and expected output.
    create table #ZDL(ZLN bigint, ZTLA int, ZMR decimal, ZCLS varchar(20), ZPITIP money)
    insert into #ZDL values(1234, 200000, 8.5, 'CART', 1500.00)
    create table #ZBL(ZLN bigint, ZBN varchar(50), ZFN varchar(20), ZMN varchar(8), ZLL varchar(20))
    insert into #ZBL values(1234, 'TEST Test', 'TEST', null, 'Test')
    create table #ZCC(ZLN bigint, ZSN int, ZCE int)
    insert into #ZCC values(1234, 1, 4)
    create table #ZP(ZLN bigint, ZPT varchar(50), ZPP int, ZNU int)
    insert into #ZP values(1234, 'Attached', 6500, 3)
    Expected XML Result should be:
    <TEST_DATA xmlns="http://www.TestData.com/Schema/Test"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.TestData.com/Schema/Test_Schema.xsd">
    <KEY _Name="ZID" _Value="789" _ID="ZID"/>
    <ZL>
    <ZLN>1234</ZLN>
    <ZTLA>200000</ZTLA>
    <ZMR>8.5</ZMR>
    <ZCLS>CART</ZCLS>
    <ZPITIP>1500.00</ZPITIP>
    </ZL>
    <ZBS>
    <ZB>
    <ZBN>TEST Test</ZBN>
    <ZFN>TEST</ZFN>
    <ZMN></ZMN>
    <ZLL>Test</ZLL>
    </ZB>
    </ZBS>
    <ZCC>
    <ZC>
    <ZSN>1</ZSN>
    <ZCE>4</ZCE>
    </ZC>
    </ZCC>
    <ZP>
    <ZPT>Attached</ZPT>
    <ZPP>6500</ZPP>
    <ZNU>3</ZNU>
    </ZP>
    </TEST_DATA>
    Thanks

    little change in your query as OP expected
    SELECT
    (SELECT ZLN ,
    ZTLA ,
    ZMR ,
    ZCLS,
    ZPITIP --AS [*]
    FROM #ZDL
    WHERE ZLN = z1.ZLN
    FOR XML PATH('ZL'),TYPE) AS [*],
    (SELECT
    ZBN ,--AS [*],
    ZFN ,
    ISNULL(ZMN,'') AS ZMN ,
    ZLL
    FROM #ZBL
    WHERE ZLN = z1.ZLN
    FOR XML PATH('ZB'),TYPE) AS [ZBS],
    (SELECT
    ZSN,ZCE
    FROM #ZCC
    WHERE ZLN = z1.ZLN
    FOR XML PATH('ZC'),TYPE) AS [ZCC],
    (SELECT
    ZPT,
    ZPP,
    ZNU
    FROM #ZP
    WHERE ZLN = z1.ZLN
    FOR XML PATH('ZP'),TYPE) AS [*]
    FROM (SELECT DISTINCT ZLN FROM #ZDL) z1
    FOR XML PATH('TEST_DATA')
    Nope
    it will give different output
    see the difference
    mine
    <TEST_DATA>
    <ZL>
    <ZLN>1234</ZLN>
    <ZTLA>200000</ZTLA>
    <ZMR>9</ZMR>
    <ZCLS>CART</ZCLS>
    1500.0000
    </ZL>
    <ZBS>
    <ZB>
    TEST Test
    <ZFN>TEST</ZFN>
    <ZMN />
    <ZLL>Test</ZLL>
    </ZB>
    </ZBS>
    <ZCC>
    <ZC>
    <ZSN>1</ZSN>
    <ZCE>4</ZCE>
    </ZC>
    </ZCC>
    <ZP>
    <ZPT>Attached</ZPT>
    <ZPP>6500</ZPP>
    <ZNU>3</ZNU>
    </ZP>
    </TEST_DATA>
    and see your output
    <TEST_DATA>
    <ZL>
    <ZLN>1234</ZLN>
    <ZTLA>200000</ZTLA>
    <ZMR>9</ZMR>
    <ZCLS>CART</ZCLS>
    <ZPITIP>1500.0000</ZPITIP>
    </ZL>
    <ZBS>
    <ZB>
    <ZBN>TEST Test</ZBN>
    <ZFN>TEST</ZFN>
    <ZMN />
    <ZLL>Test</ZLL>
    </ZB>
    </ZBS>
    <ZCC>
    <ZC>
    <ZSN>1</ZSN>
    <ZCE>4</ZCE>
    </ZC>
    </ZCC>
    <ZP>
    <ZPT>Attached</ZPT>
    <ZPP>6500</ZPP>
    <ZNU>3</ZNU>
    </ZP>
    </TEST_DATA>
    Its different from what Op wanted
    my suggestion gives exactly in the format wanted
    notice extra nodes ZPITIP and ZLN
    coming in your case
    Your original suggestion also has this issues
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • XML QUERY HELP NEEDED

    Hi,
    Need help in writing a query.
    SQL> SELECT xmlelement("P",xmlforest(P.process_id AS Ppid),
      2   xmlagg(xmlelement("PI",XMLFOREST( PI.question_id AS PIqid,
      3   PI.process_id AS PIpid,
      4   PI.innertext AS PItext),
      5   xmlagg(Xmlelement("PO",xmlforest( PO.option_id AS POoid,
      6   PO.question_id AS POqid,
      7   PO.process_id AS popid
      8   ))
      9  ORDER BY PO.option_id))
    10     ORDER BY PI.question_id ) )
    11     FROM liveProcess_ec P
    12  INNER JOIN vw_liveProcessItem_Sim_v6 PI
    13       ON P.process_id = PI.process_id
    14  LEFT OUTER JOIN vw_liveProcessOption_Sim_v6 PO
    15       ON PI.question_id = PO.question_id
    16  AND PI.process_id      = PO.process_id
    17    WHERE p.process_id   =450
    18  GROUP BY p.process_id,PI.question_id,PI.process_id,PI.innertext
    19    ORDER BY p.process_id;
    SELECT xmlelement("P",xmlforest(P.process_id AS Ppid),
    ERROR at line 1:
    ORA-00937: not a single-group group functionThanks in advance

    Hi,
    Here below are the create table scripts along with sample data and expected output.
    CREATE TABLE VW_LIVEPROCESSOPTION_SIM_v6
    ( "OPTION_ID" NUMBER,
    "QUESTION_ID" NUMBER(10,0),
    "PROCESS_ID" NUMBER(10,0),
    "OPT_INNERTEXT" VARCHAR2(200 CHAR),
    "OPT_LINKFROM" VARCHAR2(20 CHAR),
    "OPT_LINKTO" VARCHAR2(20 CHAR),
    "LIBQUESTION_IDFK" NUMBER,
    "LIBOPTION_IDFK" NUMBER
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,2,450,'Yes',null,'5',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,3,450,'Yes',null,'5',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,5,450,'Yes',null,'6',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,6,450,'Yes',null,'7',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,8,450,'Block All',null,'9',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,9,450,'Yes',null,'10',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,11,450,'Yes',null,'12',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,12,450,'Yes',null,'13',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,14,450,'Yes',null,'16',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,2,450,'No',null,'3',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,3,450,'No',null,'4',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,5,450,'No',null,'8',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,6,450,'No',null,'8',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,8,450,'Standard',null,'11',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,9,450,'No',null,'11',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,11,450,'No',null,'14',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,12,450,'No',null,'14',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,14,450,'No',null,'15',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (3,8,450,'Disabled',null,'12',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (4,8,450,'User Defined',null,'12',null,null);
    REATE TABLE "VW_LIVEPROCESSITEM_SIM_v6"
    ( "QUESTION_ID" NUMBER(10,0),
    "PROCESS_ID" NUMBER(10,0),
    "INNERTEXT" VARCHAR2(200 CHAR),
    "ITEMTYPE" VARCHAR2(50 CHAR),
    "LINKFROM" VARCHAR2(500 CHAR),
    "LINKTO" VARCHAR2(500 CHAR),
    "ASSOCIATED" VARCHAR2(200 CHAR),
    "CONTENT_ID" NUMBER,
    "EXITPOINT1_ID" NUMBER(10,0),
    "EXITPOINT2_ID" NUMBER(10,0),
    "EXITPOINT3_ID" NUMBER(10,0),
    "RESOLVEIDENTIFIER" VARCHAR2(40 CHAR),
    "LIBQUESTION_IDFK" NUMBER(10,0),
    "FOLLOWONCALL" NUMBER(1,0),
    "USERINPUT" VARCHAR2(200 CHAR),
    "ISLOCKED" NUMBER(1,0),
    "PREVIOUSANSWER" NUMBER(1,0),
    "VISIBLETOAGENT" NUMBER(1,0),
    "RETRYATTEMPT" NUMBER(10,0),
    "TAGS" VARCHAR2(50 BYTE)
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (1,450,'CBB1015 - Router Firewall Settinngs Process','Title',null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (2,450,'Is the customers PC Firewall turned off?','Question','1','2.2,2.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (3,450,'Advise the customer to turn off the PC Firewall in order to continue. Has this been done?','Question','2.2','3.2,3.1',null,278,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (4,450,'Advise the customer the PC Firewall must be switched off before this process????','ExitPoint','3.2',null,null,null,14,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (5,450,'Is the customer able to access the internet now?','Question','3.1,2.1','5.2,5.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (6,450,'Is the customer having a problem with a specific website?','Question','5.1','6.2,6.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (7,450,'1536: CBB1008 - Browser Setup and Daignostics','SubProcess','6.1',null,'1536-1-0',null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (8,450,'What is the security level on the CPE Management page?','Question','6.2,5.2','8.4,8.3,8.2,8.1',null,279,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (9,450,'Change the security level to Standard. Does this resolve the customers issue?','Question','8.1','9.2,9.1',null,280,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (10,450,'Issue Resolved','ExitPoint','9.1',null,null,null,1,6,122,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (11,450,'Change the security level to Disabled. Is the customer able to browse the internet?','Question','9.2,8.2','11.2,11.1',null,281,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (12,450,'Change the security level to Standard. Is the customer able to browse the internet now?','Question','11.1,8.3,8.4','12.2,12.1',null,283,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (13,450,'Issue Resolved','ExitPoint','12.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (14,450,'Ask the customer to perform a master reset. Does this resolve their issue?','Question','12.2,11.2','14.2,14.1',null,282,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (15,450,'Faulty CPE','ExitPoint','14.2',null,null,null,1,6,124,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (16,450,'Issue Resolved','ExitPoint','14.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
    CREATE TABLE "LIVEPROCESS_EC_V"
    ( "PROCESS_ID" NUMBER(10,0),
    "USER_ID" NUMBER(10,0),
    "CREATED" TIMESTAMP (6)
    Insert into LIVEPROCESS_EC (PROCESS_ID,USER_ID,CREATED) values (450,7460,to_timestamp('21-APR-08 09.34.41.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));Expected Output
    <P>
      <Ppid>450</Ppid>
      <Pn>CBB1015 - Router Firewall Settinngs Process</Pn>
      <Pg>9</Pg>
      <Pl>0</Pl>
      <Pb>5</Pb>
      <qcount>100</qcount>
      <ocount>200</ocount>
      <PI>
        <PIqid>1</PIqid>
        <PIpid>450</PIpid>
        <PIpx>366</PIpx>
        <PIpy>-516</PIpy>
        <PItext>CBB1015 - Router Firewall Settinngs Process</PItext>
        <PItype>Title</PItype>
        <PIto>2</PIto>
        <PO />
      </PI>
      <PI>
        <PIqid>2</PIqid>
        <PIpid>450</PIpid>
        <PIpx>366</PIpx>
        <PIpy>-437</PIpy>
        <PItext>Is the customers PC Firewall turned off?</PItext>
        <PItype>Question</PItype>
        <PIfrom>1</PIfrom>
        <PIto>2.2,2.1</PIto>
        <PO>
          <POoid>1</POoid>
          <POqid>2</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>5</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>2</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>3</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>3</PIqid>
        <PIpid>450</PIpid>
        <PIpx>468</PIpx>
        <PIpy>-344</PIpy>
        <PItext>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PItext>
        <PItype>Question</PItype>
        <PIfrom>2.2</PIfrom>
        <PIto>3.2,3.1</PIto>
        <PIc>278</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>3</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>5</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>3</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>4</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>4</PIqid>
        <PIpid>450</PIpid>
        <PIpx>571</PIpx>
        <PIpy>-250</PIpy>
        <PItext>Advise the customer the PC Firewall must be switched off before this process????</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>3.2</PIfrom>
        <PIe1>14</PIe1>
        <PO />
      </PI>
      <PI>
        <PIqid>5</PIqid>
        <PIpid>450</PIpid>
        <PIpx>374</PIpx>
        <PIpy>-240</PIpy>
        <PItext>Is the customer able to access the internet now?</PItext>
        <PItype>Question</PItype>
        <PIfrom>3.1,2.1</PIfrom>
        <PIto>5.2,5.1</PIto>
        <PO>
          <POoid>1</POoid>
          <POqid>5</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>6</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>5</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>8</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>6</PIqid>
        <PIpid>450</PIpid>
        <PIpx>322</PIpx>
        <PIpy>-141</PIpy>
        <PItext>Is the customer having a problem with a specific website?</PItext>
        <PItype>Question</PItype>
        <PIfrom>5.1</PIfrom>
        <PIto>6.2,6.1</PIto>
        <PO>
          <POoid>1</POoid>
          <POqid>6</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>7</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>6</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>8</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>7</PIqid>
        <PIpid>450</PIpid>
        <PIpx>128</PIpx>
        <PIpy>-36</PIpy>
        <PItext>1536: CBB1008 - Browser Setup and Daignostics</PItext>
        <PItype>SubProcess</PItype>
        <PIfrom>6.1</PIfrom>
        <PIas>1536-1-0</PIas>
        <PO />
      </PI>
      <PI>
        <PIqid>8</PIqid>
        <PIpid>450</PIpid>
        <PIpx>461</PIpx>
        <PIpy>-43</PIpy>
        <PItext>What is the security level on the CPE Management page?</PItext>
        <PItype>Question</PItype>
        <PIfrom>6.2,5.2</PIfrom>
        <PIto>8.4,8.3,8.2,8.1</PIto>
        <PIc>279</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>-112</POpx>
          <POpy>89</POpy>
          <POtext>Block All</POtext>
          <POto>9</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>Standard</POtext>
          <POto>11</POto>
        </PO>
        <PO>
          <POoid>3</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>83</POpx>
          <POpy>116</POpy>
          <POtext>Disabled</POtext>
          <POto>12</POto>
        </PO>
        <PO>
          <POoid>4</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>-14</POpx>
          <POpy>94</POpy>
          <POtext>User Defined</POtext>
          <POto>12</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>9</PIqid>
        <PIpid>450</PIpid>
        <PIpx>237</PIpx>
        <PIpy>76</PIpy>
        <PItext>Change the security level to Standard. Does this resolve the customers issue?</PItext>
        <PItype>Question</PItype>
        <PIfrom>8.1</PIfrom>
        <PIto>9.2,9.1</PIto>
        <PIc>280</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>9</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>10</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>9</POqid>
          <popid>450</popid>
          <POpx>69</POpx>
          <POpy>73</POpy>
          <POtext>No</POtext>
          <POto>11</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>10</PIqid>
        <PIpid>450</PIpid>
        <PIpx>158</PIpx>
        <PIpy>185</PIpy>
        <PItext>Issue Resolved</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>9.1</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>122</PIe3>
        <PO />
      </PI>
      <PI>
        <PIqid>11</PIqid>
        <PIpid>450</PIpid>
        <PIpx>821</PIpx>
        <PIpy>144</PIpy>
        <PItext>Change the security level to Disabled. Is the customer able to browse the internet?</PItext>
        <PItype>Question</PItype>
        <PIfrom>9.2,8.2</PIfrom>
        <PIto>11.2,11.1</PIto>
        <PIc>281</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>11</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>12</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>11</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>14</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>12</PIqid>
        <PIpid>450</PIpid>
        <PIpx>474</PIpx>
        <PIpy>186</PIpy>
        <PItext>Change the security level to Standard. Is the customer able to browse the internet now?</PItext>
        <PItype>Question</PItype>
        <PIfrom>11.1,8.3,8.4</PIfrom>
        <PIto>12.2,12.1</PIto>
        <PIc>283</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>12</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>13</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>12</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>14</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>13</PIqid>
        <PIpid>450</PIpid>
        <PIpx>322</PIpx>
        <PIpy>278</PIpy>
        <PItext>Issue Resolved</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>12.1</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>123</PIe3>
        <PO />
      </PI>
      <PI>
        <PIqid>14</PIqid>
        <PIpid>450</PIpid>
        <PIpx>645</PIpx>
        <PIpy>327</PIpy>
        <PItext>Ask the customer to perform a master reset. Does this resolve their issue?</PItext>
        <PItype>Question</PItype>
        <PIfrom>12.2,11.2</PIfrom>
        <PIto>14.2,14.1</PIto>
        <PIc>282</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>14</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>16</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>14</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>15</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>15</PIqid>
        <PIpid>450</PIpid>
        <PIpx>768</PIpx>
        <PIpy>435</PIpy>
        <PItext>Faulty CPE</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>14.2</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>124</PIe3>
        <PO />
      </PI>
      <PI>
        <PIqid>16</PIqid>
        <PIpid>450</PIpid>
        <PIpx>479</PIpx>
        <PIpy>420</PIpy>
        <PItext>Issue Resolved</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>14.1</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>123</PIe3>
        <PO />
      </PI>
    </P>Thanks in advance.

  • Intermedia - XML query help

    I do the following at a sqlplus command window
    create table xml (
    id number,
    xmltext clob);
    insert into xml values (1,'<a><b><c>steve</c></b></a>');
    exec ctx_ddl.create_section_group ('mysectiongroup','xmlsectiongroup');
    exec ctx_ddl.add_zone_section('mysectiongroup','a','a');
    exec ctx_ddl.add_zone_section('mysectiongroup','b','b');
    exec ctx_ddl.add_field_section('mysectiongroup','c','c');
    create index my_index on xml (xmltext) indextype is ctxsys.context parameters('section group mysectiongroup');
    select count(*) from xml where contains (xmltext,
    '(steve within ( c within (b within a)))');
    and count = 0, How can I get this to work ?

    Seems the insert left out my tags
    should look like this with lb = < and rb = >
    insert into xml values (1,"'lb a rb lb b rb lb c rb steve lb/c rb lb/b rb lb/a rb'");

  • Help Needed XML query

    I have troubles with my XML query. It returns to many results and double results.
    My code
    select xmlelement("test", XMLAgg(xmlelement("Customer", XmlAttributes(a.CUSTOMER_ID "cid"))),
    XMLAgg(xmlelement("Account", xmlagg(xmlelement("Account", b.ACCOUNT_ID) ))),
    XMLAgg(xmlelement("ServicePoint", xmlagg(xmlelement("sp", c.SPID) ))) ).extract('*').getstringval() xml
    From DM_SERVICE_POINT c, DM_CUSTOMER a, DM_ACCOUNT b where a.CUSTOMER_ID = b.CUSTOMER_ID And a.CUSTOMER_ID=c.CUSTOMER_ID AND a.CUSTOMER_ID='15058'
    group by a.CUSTOMER_ID
    i have 1 customer id in the table dm_customer, 2 account_id 's that are linked to customer_id with a FK. DM_Servicepoint contains 6 rows that are linked to dm_customer with a FK.
    My result is 1 result for customer, thats correct but account shows 12 results, where i expect 2 results
    and Service point shows also 12 records where i expect 6 records.
    There is no direct link between account and service point but both are linked to customer. Each customer can have 1 or 2 account And each customer can have 1 or many servicepoints.
    Can you help me?
    Message was edited by:
    Marinda

    Now to see whether we can get this to work with XML....Turns out it's a lot easier than I thought it would be:
    SQL> select dbms_xmlgen.getxml('select c.name
      2         , cursor(select a.acctno, a.name
      3                  from my_accounts a
      4                  where a.cust_id = c.id ) as accounts
      5         , cursor(select s.sp_ref
      6                  from my_service_points s
      7                  where s.cust_id = c.id ) as srv_points
      8  from   my_customers c
      9  ') from dual
    10  /
    DBMS_XMLGEN.GETXML('SELECTC.NAME,CURSOR(SELECTA.ACCTNO,A.NAMEFROMMY_ACCOUNTSAWHE
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <NAME>APC</NAME>
      <ACCOUNTS>
       <ACCOUNTS_ROW>
        <ACCTNO>900000</ACCTNO>
        <NAME>No1 a/c</NAME>
       </ACCOUNTS_ROW>
       <ACCOUNTS_ROW>
        <ACCTNO>900002</ACCTNO>
        <NAME>Business</NAME>
       </ACCOUNTS_ROW>
      </ACCOUNTS>
      <SRV_POINTS>
       <SRV_POINTS_ROW>
        <SP_REF>SP1</SP_REF>
       </SRV_POINTS_ROW>
       <SRV_POINTS_ROW>
        <SP_REF>SP2</SP_REF>
       </SRV_POINTS_ROW>
       <SRV_POINTS_ROW>
        <SP_REF>SP3</SP_REF>
       </SRV_POINTS_ROW>
       <SRV_POINTS_ROW>
        <SP_REF>SP4</SP_REF>
       </SRV_POINTS_ROW>
       <SRV_POINTS_ROW>
        <SP_REF>SP5</SP_REF>
       </SRV_POINTS_ROW>
       <SRV_POINTS_ROW>
        <SP_REF>SP6</SP_REF>
       </SRV_POINTS_ROW>
      </SRV_POINTS>
    </ROW>
    <ROW>
      <NAME>MARINDA</NAME>
      <ACCOUNTS>
       <ACCOUNTS_ROW>
        <ACCTNO>900004</ACCTNO>
        <NAME>Checking</NAME>
       </ACCOUNTS_ROW>
      </ACCOUNTS>
      <SRV_POINTS>
       <SRV_POINTS_ROW>
        <SP_REF>SP7</SP_REF>
       </SRV_POINTS_ROW>
       <SRV_POINTS_ROW>
        <SP_REF>SP8</SP_REF>
       </SRV_POINTS_ROW>
      </SRV_POINTS>
    </ROW>
    </ROWSET>
    SQL> Obviously you'll need to do some smartening up of the tag names.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Problem in xml query

    Hi
    I am working on BLS and having problem in xml query.I want to perform some calculation over xml columns.Than total of this as a new column.I can do this part in logic editor itself but can i do these both task by XSLT.
    Can be made our own XSLT for this ?
    I am feeling kind of fear to xslt. Can anybody help me in this.
    Thanks a lot in advance
    thomas

    Ram,
    In xMII there is a list of predefined xslt transforms that do something similar to what you are explaining.  The 3 that I think may be what you are looking for are
    they are under Calculation Transformations and Subtotal Transformation take a look at these and tell me if they are doing what you want to accomplish.  In the xMII help file do a search on Inline Transforms or navigate to Advanced Topics -> Inline Transforms -> Predefined Inline Transforms.  In this section there are examples of how to use these transforms and apply them in the query templates.  If this is not what you are looking for can you explain in a little more detail along with a simple example of how you want this transform to work.  Also why do you want to use xslt if you can already accomplish this in BLS?
    Regards,
    Erik

  • XML query structure problem

    Hi experts,
    I am looking for help on the following XML query. I have a table (example) organized as such:
    meas     data_element     
    ABC     rate                  
    DEF     rate1                   
    DEF     rate2                   
    DEF     rate3                   
    GHI     rate                   
    JKL     rate1a           
    JKL     rate2b             I'm trying to keep the "meas" column as the top node attribute, with the "data_elements" as attributes of the children of "meas"
    In short, I'm looking for the following output, but, well..keep coming up short.
    <meas id="ABC">
         <data_elements>
            <data_element id="rate">
                <rpt>false</rpt>
             </data_element>
        </data_elements>
    </meas>
    <meas id="DEF">
         <data_elements>
              <data_element id="rate1">
                   <rpt>false</rpt>
              </data_element>
                     <data_element id="rate2">
                   <rpt>false</rpt>
              </data_element>
              <data_element id="rate3">
                      <rpt>false</rpt>
              </data_element>
         <data_elements>
    </meas>
    .....and so forth...I'm having trouble with getting the multiple rows of 'data_element' under 'data_elements', and under the single 'meas' one node, any suggestions? My code keeps generating multiple rows. The rpt node is a constant value of 'false'
    Thanks

    You have to group, and aggregate using XMLAgg :
    SQL> set long 5000
    SQL>
    SQL> with sample_data (meas, data_element) as (
      2    select 'ABC',     'rate'   from dual union all
      3    select 'DEF',     'rate1'      from dual union all
      4    select 'DEF',     'rate2'  from dual union all
      5    select 'DEF',     'rate3'  from dual union all
      6    select 'GHI',     'rate'   from dual union all
      7    select 'JKL',     'rate1a' from dual union all
      8    select 'JKL',     'rate2b' from dual
      9  )
    10  select xmlserialize(content
    11           xmlagg(
    12             xmlelement("meas",
    13               xmlattributes(meas as "id")
    14             , xmlelement("data_elements",
    15                 xmlagg(
    16                   xmlelement("data_element",
    17                     xmlattributes(data_element as "id")
    18                   , xmlelement("rpt", 'false')
    19                   )
    20                   order by data_element -- if necessary
    21                 )
    22               )
    23             )
    24           )
    25           indent
    26         ) as result
    27  from sample_data
    28  group by meas ;
    RESULT
    <meas id="ABC">
      <data_elements>
        <data_element id="rate">
          <rpt>false</rpt>
        </data_element>
      </data_elements>
    </meas>
    <meas id="DEF">
      <data_elements>
        <data_element id="rate1">
          <rpt>false</rpt>
        </data_element>
        <data_element id="rate2">
          <rpt>false</rpt>
        </data_element>
        <data_element id="rate3">
          <rpt>false</rpt>
        </data_element>
      </data_elements>
    </meas>
    <meas id="GHI">
      <data_elements>
        <data_element id="rate">
          <rpt>false</rpt>
        </data_element>
      </data_elements>
    </meas>
    <meas id="JKL">
      <data_elements>
        <data_element id="rate1a">
          <rpt>false</rpt>
        </data_element>
        <data_element id="rate2b">
          <rpt>false</rpt>
        </data_element>
      </data_elements>
    </meas>

  • Error in testing XML query result set web service

    Hi
    I was trying to test a <b>XML query result set web service</b> in BW system with tcode wsadmin but getting error like
    <b>Cannot download WSDL from http://ibmbtsb02.megacenter.de.ibm.com:8070/sap/bw/xml/soap/queyview?sap-client=001&wsdl=1.1&mode=sap_wsdl: F:\usr\sap\W70\DVEBMGS70\j2ee\cluster\server0\apps\sap.com\com.sap.engine.services.webservices.tool\servlet_jsp\wsnavigator\root\WEB-INF\temp\ws1139464945296\wsdls\wsdlroot.wsdl (The system cannot find the path specified)</b>
    I had tried it first time few days ago and was able to test it successfully with the same configuration settings.
    Could any one of you please provide any suggestion on this?
    Thanks in advance
    Sudip

    hi
    check this links it may help u.
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/e3072e65f04445a010847aa970b68b/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/d8/3bfc3f8fc2c542e10000000a1550b0/frameset.htm
    Regards,
    Manoseelan

  • No method found for XML query element

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

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

  • How to call both xacute query and xml query inside a single applet

    Hi,
    I am very new to XMII. Trying with a simple exercises now.
    1.  I have a Business Logic Transaction which will call external application using web services then it will get an output as xml and storing it in C:\.
    2. Then I created one xacute query which will call the transaction
    3. Then I created a xml query that will read the xml in c:\ and I too created a visual display template(ichart)  for it
    4. Created a html file -- created a applet , called all the 3 inside it. NOt getting any graph in IE
    5. But if I call only xml query and display query its working
    <b>following are my HTML file:</b>
    <html>
    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Order Percent Complete</title>
    </head>
    <body>
    <p>
    <APPLET NAME="MyApplet" WIDTH="640" HEIGHT="400" CODE="iChart" CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>
    <PARAM NAME="QueryTemplate" VALUE="UserTemplates/POTxnTemplate">
    <PARAM NAME="QueryTemplate" VALUE="UserTemplates/POTemplate">
    <PARAM NAME="DisplayTemplate" VALUE="UserTemplates/POVisual">
    </APPLET>
    </p>
    </body>
    </html>
    6. In POTxnTemplate -- calling Transaction BL
        In POTemplate -- fetching xml from c:\
        In POVisual -- displaying the ichart (using POTemplate)
    Can any one help me with this?
    I am doing in the right path?
    Thanks in Advance,
    Murugappan.

    Hello,
    You can only enter one query template into an applet.  Use the xacute query template.  In the transaction assign the output of the web services results to a transaction property of type xml making sure you select the "Output Parameter?" option.  These results will need to be in xMII format.  Then open the xacute query template and verify that the output parameter you created is selected as an Output on the transaction tab.

  • Merge Join Cartesian in XML query

    Hi Sir
    I am getting Merge join cartesian in the below XML query
    SELECT
    x.empno,
    x1.empno AS INDEXempno
    FROM
    emp_vw x,
    emp_index x1,
    table (xmlsequence(extract(x1.xml_data,'/emp/org/constituent/'))) c
    WHERE x.empno = extractvalue(VALUE(c),'/constituent/code/text()');
    I am getting Merge join cartesian in XML query. whereeas below query i am running by I am not getting merge join cartesian
    SELECT
    x.empno,
    x1.empno AS INDEXempno
    FROM
    emp_vw_v6 x,
    emp_index_v6 x1,
    table (xmlsequence(extract(x1.xml_data,'/emp/org/constituent/'))) c
    WHERE x.empno = extractvalue(VALUE(c),'/constituent/code/text()');
    Here emp_vw is a view and emp_index is a table.This is not giving merge join cartesian
    However both the view and table are interdependent.
    Please help me to resolve the performance of the first query as it is taking a lot of time to execute.?
    Thanks & Regards
    Thakur Manoj R

    Please post a working test case, and follow the guidelines here : {message:id=9360002}
    What are the differences between the view and table in the first query and the two others (*_v6) in the second query?                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Different row count for select versus insert in XML query

    Hi,
    I encounter a situation where a SELECT * returns a different rows count than an INSERT INTO... (SELECT *) by xmltable join. This makes no sense at all!!!
    In breif, I tried to convert xml data into traditional relational tables. I wrote an xml query to select data from xmltable... I checked row count. When I used "create table as select" that was the same query above, I got correct row count. However when I used "insert into select" that was the same query above, I got the wrong info in the table I just inserted.
    Does any one have any idea what caused this issue? Thanks for your help.

    DUPLICATE post
    count of rows in a schema tables

  • Query Help-2

    Query Help:
    http://forum.java.sun.com/thread.jsp?forum=45&thread=471180&tstart=15&trange=15
    It seems I have confused enough people with my improper presentation of query. Sorry guys. I will restate my question with different table names.
    The above was my previous posting, which was not clear..so Iam restating my problem as follows....
    I have the following tables
    Customer(custID, Name, Address)
    Order(custID, OrderID, orderDate)
    CreditCard(custID, creditCard#, creditCardType)
    Now if I have 3 records in Order with custID 100 and 2 records in CreditCard as
    Order:
    100,A001,11/22/03
    100,A002,11/24/03
    100,A003,12/02/03
    CreditCard:
    100,42323232..., VISA
    100,5234234...., MASTER
    Now how can I get
    custID, Name, Address, OrderID, orderDate, creditCard#, creditCarType
    data in minimum no. of records....
    I think I have made my query clear..
    now please help me guys...
    thanks so much for your help.

    You are right.
    But frankly the actual tables on my database are not customer,orders and creditcards..but I just tried to reproduce the problem with these tables, please ignore that user needs a refund etc situtaion. If the tables were actually order,creditcards etc..it would have been a problem to be considered.
    Can you please help me with the query
    if I have m rows in Order and n rows in CreditCard. I will get m*n records, I looking for max(m,n).
    With the following fields in my query result,
    custID, Name, Address, OrderID, orderDate, creditCard#, creditCarType
    from Customer, Order, CreditCard tables
    Thanks so much for your htlp

  • SQL Query Help - Is this possible or impossible????

    Hi guys,
    I need help with an SQL query that I'm trying to develop. It's very easy to explain but when trying to implement it, I'm struggling to achieve the results that I want.....
    For example,
    I have 2 tables
    The first table is:
    1) COMPANY create table company (manufacturer varchar2(25),
                                                          date_established date,
                                                          location varchar2(25) );My sample test date is:
    insert into company values ('Ford', 1902, 'USA');
    insert into company values ('BMW', 1910, 'Germany');
    insert into company values ('Tata', 1922, 'India');The second table is:
    2) MODELS create table models (manufacturer varchar(25),
                                                 model varchar2(25),
                                                 price number(10),
                                                 year date,
                                                 current_production_status varchar2(1) ) ;My sample test data is:
    insert into models values ('Ford', 'Mondeo', 10000, 2010, 0);
    insert into models values ('Ford', 'Galaxy', 12000,   2008, 0);
    insert into models values ('Ford', 'Escort', 10000, 1992, 1);
    insert into models values ('BMW', '318', 17500, 2010, 0);
    insert into models values ('BMW', '535d', 32000,   2006, 0);
    insert into models values ('BMW', 'Z4', 10000, 1992, 0);
    insert into models values ('Tata', 'Safari', 4000, 1999, 0);
    insert into models values ('Tata', 'Sumo', 5500,   1996, 1);
    insert into models values ('Tata', 'Maruti', 3500, 1998, 0);And this is my query:
    SELECT
            com.manufacturer,
            com.date_established,
            com.location,
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.model),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.price),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.year),
            mod.current_production_status
    FROM
           company com,
           models mod
    WHERE
          mod.manufacturer = com.manufacturer
          and com.manufacturer IN ('Ford', 'BMW', 'Tata')
          and mod.current_production_status IN (1,0)
    ORDER BY
            mod.current_production_status DESCWhat I want the query to output is this:
    com.manufacturer        com.date_established          com.location          mod.model          mod.price             mod.year     mod.current_production_status
    Ford               1902                    USA               Escort               10000               1992          1
    BMW               1910                    Germany               -               -               -          0
    Tata               1922                    India               Sumo               5500               1998          1If current_production_status is 1 it means this particular model has been discontinued
    If current_production_status is 0 it means the manufacturer does not have any discontinued models and all are in procuction.
    The rule is only one record per manufacturer is allowed to have a current_production_status of 1 (so only one model from the selection the manufactuer offers is allowed to be discontinued).
    So the query should output the one row where current_production_status is 1 for each manufacturer.
    If for a given manufacturer there are no discontinued models and all have a current_production_status of 0 then ouput a SINGLE row that only includes the data from the COMPANY table (as above). The rest of the columns from the MODELS table should be populated with a '-' (hyphen).
    My query as it is above will output all the records where current status is 1 or 0 like this
    com.manufacturer        com.date_established          com.location          mod.model          mod.price          mod.year     mod.current_production_status
    Ford               1902                    USA               Escort               10000               1992          1
    Tata               1922                    India               Sumo               5500               1998          1
    Ford               1902                    USA               -               -               -          0                    
    Ford               1902                    USA               -               -               -          0
    BMW               1910                    Germany               -               -               -          0
    BMW               1910                    Germany               -               -               -          0
    BMW               1910                    Germany               -               -               -          0
    Tata               1922                    India               -               -               -          0
    Tata               1922                    India               -               -               -          0However this is not what I want.
    Any ideas how I can achieve the result I need?
    Thanks!
    P.S. Database version is '10.2.0.1.0'

    Hi Vishnu,
    Karthiks query helped...
    But this is the problem I am facing...
    SELECT
            com.manufacturer,
            com.date_established,
            com.location,
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.model),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.price),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.year),
            mod.current_production_status
    FROM
           company com,
           models mod
    WHERE
          mod.manufacturer = com.manufacturer
          and com.manufacturer = 'Ford'
          and mod.current_production_status IN (1,0)
    ORDER BY
            mod.current_production_status DESCThe value of:
    and com.manufacturer = 'Ford'will be dependent on front end user input....
    When I run the query above I get all the rows where current_production_status is either 1 or 0.
    I only require the rows where current_production_status is 1.
    So if I amend it to look like this:
         and mod.current_production_status = 1This works....
    BUT if a user now passes in more than one manufacturer EG:
    and com.manufacturer IN ('Ford', 'BMW')The query will only return the one row for Ford where current_production_status is 1. However because BMW has no models where current_production_status is 1 (all 3 are 0), I still want this to be output - as one row....
    So like this:
    com.manufacturer        com.date_established          com.location          mod.model          mod.price             mod.year     mod.current_production_status
    Ford               1902                    USA               Escort               10000               1992          1
    BMW               1910                    Germany               -               -               -          0So (hopefully you understand), I want both cases to be catered for.....whether a user enters one manufacturer or more than one...
    Thanks you so much!
    This is really driving me insane :-(

Maybe you are looking for