Query with XMLTABLE returns null rows

Hello all,
I'm trying a query with XMLTABLE, but even thought the number of returned rows is correct, the row content is (null).
DB version is: 10.2.0.4.0
Here is my query;
SELECT s.DESCRIPTION
FROM EXECUTIONPLAN p,
  XMLTABLE
  ('//executionPlan/executionPlanItems/summary'  
   PASSING p.DATA
   COLUMNS
     DESCRIPTION VARCHAR(250) PATH '/taskId'
  ) s
WHERE
trunc(extractValue(data, '/executionPlan/executionPlanHeader/statusChanged')) = to_date('2010-03-05','YYYY-MM-DD');Sorry the XML content is quite big -50k lines at average- so can't post the whole XML, but to give an idea;
/executionPlan
   /executionPlan
      /executionPlanHeader
         /statusChanged
         /x
         /y
      /executionPlanItems
         /summary
            /taskId
         /summary
         /summary
         ...The result looks like;
1 (null)
2 (null)
3 (null)
4 (null)
...Suggestions are very much appreciated :)
Cheers

Hi guys,
Cracked it at last. It seems the column definition part does not like the forward slash in front of it. The following works;
SELECT s.DESCRIPTION
FROM EXECUTIONPLAN p,
  XMLTABLE
  ( XmlNamespaces(DEFAULT 'http://www.staffware.com/frameworks/gen/valueobjects'),
   '/executionPlan/executionPlanItems/summary'  
   PASSING p.DATA
   COLUMNS
     DESCRIPTION VARCHAR(250) PATH 'taskId'
  ) s
WHERE
trunc(extractValue(p.data, '/executionPlan/executionPlanHeader/statusChanged'
                         , 'xmlns="http://www.staffware.com/frameworks/gen/valueobjects"')) = to_date('2010-03-05','YYYY-MM-DD');I'm not sure if this is the way it is intended since it seems a bit weird to me and is not in line with the docs - or at least my understanding of them.
Thanks for taking the time to help out. Now on to coding :)

Similar Messages

  • SQL Query (PL/SQL Function Body returning SQL query) doesn't return any row

    I have a region with the following type:
    SQL Query (PL/SQL Function Body returning SQL query).
    In a search screen the users can enter different numbers, separated by an ENTER.
    I want to check these numbers by replacing the ENTER, which is CHR(13) || CHR(10) I believe, with commas. And then I can use it like this: POD IN (<<text>>).
    It's something like this:
    If (:P30_POD Is Not Null) Then
    v_where := v_where || v_condition || 'POD IN (''''''''||REPLACE(''' || :P30_POD || ''', CHR(13) || CHR(10), '','')||'''''''''')';
    v_condition := ' AND ';
    End If;
    But the query doesn't return any rows.
    I tried to reproduce it in Toad:
    select * from asx_worklistitem
    where
    POD IN (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
    ==> This is the query that does't return any rows
    select (''''||REPLACE('541449200000171813'||CHR(13) || CHR(10)||'541449206006341366', CHR(13) || CHR(10), ''',''')||'''')
    from dual;
    ==> This returns '541449200000171813','541449206006341366'
    select * from asx_worklistitem
    where pod in ('541449200000171813','541449206006341366');
    ==> and when I copy/paste this in the above query, it does return my rows.
    So why does my first query doesn't work?
    Doe anyone have any idea?
    Kind regards,
    Geert
    Message was edited by:
    Zorry

    Thanks for the help.
    I made it work, but via the following code:
    If (:P30_POD Is Not Null) Then
    v_pods := REPLACE(:P30_POD, CHR(13) || CHR(10));
    v_where := v_where || v_condition || 'POD IN (';
    v_counter := 1;
    WHILE (v_counter < LENGTH(v_pods)) LOOP
    v_pod := SUBSTR(v_pods, v_counter, 18);
    IF (v_counter <> 1) THEN
    v_where := v_where || ',';
    END IF;
    v_where := v_where || '''' || v_pod || '''';
    v_counter := v_counter + 18;
    END LOOP;
    v_where := v_where || ')';
    v_condition := ' AND ';
    End If;But now I want to make an update of all the records that correspond to this search criteria. I can give in a status via a dropdownlist and that I want to update all the records that correspond to one of these POD's with that status.
    For a region you can build an SQL query via PL/SQL, but for a process you only have a PL/SQL block. Is the only way to update all these records by making a loop and make an update for every POD that is specified.
    Because I think this will have a lot of overhead.
    I would like to make something like a multi row update in an updateable report, but I want to specify the status from somewhere else. Is this possible?

  • Simple Query with subquery returns the 'wrong' result

    DB version: 11.2
    We created about 27 schemas in the last 4 days. The below query confirms that.
    SQL > select username, created from dba_users where created > sysdate-4;
    USERNAME                       CREATED
    MANHSMPTOM_DEV_01              12 Jul 2012 11:55:16
    PRSM01_OAT_IAU                 13 Jul 2012 01:51:03
    F_SW                           11 Jul 2012 17:52:42
    FUN_CDD_HK_SIT                 09 Jul 2012 15:33:57
    CEMSCOMPTOM_UAT_01             12 Jul 2012 11:43:45
    STORM02_OAT_IAU                13 Jul 2012 02:06:29
    27 rows selected.  -------------> Truncated outputFrom DBA_TS_QUOTAS.max_bytes column , we can determine the space quota allocated for a user/schema
    SQL > desc dba_ts_quotas
    Name                                      Null?    Type
    TABLESPACE_NAME                           NOT NULL VARCHAR2(30)
    USERNAME                                  NOT NULL VARCHAR2(30)
    BYTES                                              NUMBER
    MAX_BYTES                                          NUMBER
    BLOCKS                                             NUMBER
    MAX_BLOCKS                                         NUMBER
    DROPPED                                            VARCHAR2(3)So, I wanted to see the allocated space for the users created in the last 4 days. The below query should return only 27 records because the subquery returns only 27 records. Instead it returned 66 records !
    select username, tablespace_name, max_bytes/1024/1024 quotaInMB
    from dba_ts_quotas
    where username in (select username from dba_users where created > sysdate-4);Any idea why ? I know it is not a bug with oracle. Its just I haven't been eating fish lately.

    Hi,
    J.Kiechle wrote:
    So, I wanted to see the allocated space for the users created in the last 4 days.DBA_TS_QUOTAS doesn't give the allocated space but rather the maximum allowed for a given user.
    J.Kiechle wrote:
    The below query should return only 27 records because the subquery returns only 27 records. Instead it returned 66 records !What if your user John has Quotas on 3 tablespace TBS1, TBS2 and TBS3 ?
    You cannot expect the outer query to only retrieve at most 27 rows just because the inner query returns 27 rows.
    For allocated space by tablespace for recently created users, you'd better query dba_segments. something like :select owner, tablespace_name, trunc(sum(bytes)/1024/1024) alloc_mb
    from dba_segments
    where owner in (select username from dba_users where created > sysdate - 4)
    group by owner, tablespace_name
    order by owner, tablespace_name;

  • Subquery not returning NULL rows

    Hi,
    I have been working with SQL since very long, but sorry, I have not come across following problem.
    In the FROM clause, I use one sub query and a table. If I run sub query alone, it lists records even if rows with RATE=NULL.
    But when I join sub query with other table, it is not fetching any records for RATE=NULL.
    SELECT *
    FROM
    (SELECT key, perceivedseverity, eventtime, nvl(rate,'NA') rate FROM tr_alarm_history a
    WHERE eventtime = (SELECT MAX(eventtime) FROM tr_alarm_history WHERE key = a.key)) a,
    tr_lot_list b
    WHERE a.key = b.localtargetname
    and b.ttid='IM_20110516_8711' ;
    The sub query -
    " SELECT key, perceivedseverity, eventtime, nvl(rate,'NA') rate FROM tr_alarm_history a
    WHERE eventtime = (SELECT MAX(eventtime) FROM tr_alarm_history WHERE key = a.key) "
    returns all records including RATE=NULLs. But when I join them, RATE columns with NULL will be filtered. Please note that joining condition (WHERE a.key = b.localtargetname) is not a problem as they will always match irrespective of RATE having NULL.
    Please let me know why this behaviour and is there any other alternative where in I can get the records even if RATE column is NULL.
    Thanks a lot for your help.
    -Anand

    I am extreemly sorry. 2 or 3 examples I took were wrong one's, which were not having RATE=NULL. So I got into such confusion.
    PLEASE INORE MY QUESTION.
    And thanks for your valuable time.
    With Best Wishes,
    -Anand

  • PO_HEADERS_V return null rows

    I want to make a report but problem is this when i query to PO_HEADERS_V. It shows null rows.

    My current understanding is that you are viewing data in SQLPLUS/TOAD or some other similar tool. So you can initialize APPS before running the query on the View. Things should be okay. Can you please check the value returned by userenv('LANG') in your sqlplus and then pick the query of the PO_HEADERS_V and check the condition which causes the failure
    Regards
    Sumit

  • Xmltable returning no rows

    I have the following XML
    <?xml version = '1.0' encoding = 'UTF-8'?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:sawsoap="urn://oracle.bi.webservices/v6">
       <soap:Body>
          <sawsoap:getGroupsResult>
             <sawsoap:account xsi:type="sawsoap:Account">
                <sawsoap:name>Presentation Server Administrators</sawsoap:name>
                <sawsoap:accountType>1</sawsoap:accountType>
                <sawsoap:guid>bipse53c4188a730640cc6c0a242</sawsoap:guid>
             </sawsoap:account>
             <sawsoap:account xsi:type="sawsoap:Account">
                <sawsoap:name>AuthenticatedUser</sawsoap:name>
                <sawsoap:accountType>4</sawsoap:accountType>
                <sawsoap:guid>AuthenticatedUser</sawsoap:guid>
             </sawsoap:account>
             <sawsoap:account xsi:type="sawsoap:Account">
                <sawsoap:name>BIConsumer</sawsoap:name>
                <sawsoap:accountType>4</sawsoap:accountType>
                <sawsoap:guid>BIConsumer</sawsoap:guid>
             </sawsoap:account>
          </sawsoap:getGroupsResult>
       </soap:Body>
    </soap:Envelope>I am trying to generate the list of account types, which in this case would just be
    Presentation Server Administrators
    AuthenticatedUser
    BIConsumer
    I am using the following SQL statement in my attempt, but it is returning zero rows.
    select x.*
    from tony, xmltable ('/account'
    passing extract(x,'//sawsoap:getGroupsResult','xmlns:sawsoap="urn://oracle.bi.webservices/v6"')
    columns
    group_name varchar2(255) path '/name'
    ) x;I have tried different combinations of XPaths, including the sawsoap:account and sawsoap:name,but other continue to return no records. I have the sense that I am close and would appreciate a second set of eyes that could point out the mistake.
    Tony

    Welcome to the forums. When posting, always include your version as shown by
    select * from v$version
    It makes a difference. For your issue, you are mixing some pre 10.2 syntax (extract) with 10.2 and later syntax (XMLTable).
    What you are looking for is something like
    WITH tony AS
    (SELECT XMLTYPE('<?xml version = ''1.0'' encoding = ''UTF-8''?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:sawsoap="urn://oracle.bi.webservices/v6">
       <soap:Body>
          <sawsoap:getGroupsResult>
             <sawsoap:account xsi:type="sawsoap:Account">
                <sawsoap:name>Presentation Server Administrators</sawsoap:name>
                <sawsoap:accountType>1</sawsoap:accountType>
                <sawsoap:guid>bipse53c4188a730640cc6c0a242</sawsoap:guid>
             </sawsoap:account>
             <sawsoap:account xsi:type="sawsoap:Account">
                <sawsoap:name>AuthenticatedUser</sawsoap:name>
                <sawsoap:accountType>4</sawsoap:accountType>
                <sawsoap:guid>AuthenticatedUser</sawsoap:guid>
             </sawsoap:account>
             <sawsoap:account xsi:type="sawsoap:Account">
                <sawsoap:name>BIConsumer</sawsoap:name>
                <sawsoap:accountType>4</sawsoap:accountType>
                <sawsoap:guid>BIConsumer</sawsoap:guid>
             </sawsoap:account>
          </sawsoap:getGroupsResult>
       </soap:Body>
    </soap:Envelope>') x
       FROM dual)
    -- The above WITH simulates your table.  You only care about the below  
    SELECT x.*
      FROM tony,
           XMLTable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "soap",
                                  'urn://oracle.bi.webservices/v6' AS "sawsoap"),
                    '/soap:Envelope/soap:Body/sawsoap:getGroupsResult/sawsoap:account'
                    PASSING tony.x
                    COLUMNS
                    group_name   VARCHAR2(40) PATH 'sawsoap:name'
                   ) x;
    GROUP_NAME
    Presentation Server Administrators
    AuthenticatedUser
    BIConsumer

  • Query from User_Scheduler_Jobs returns no rows in version 2.1.0.63

    Using version 2.1.0.63, "select * from user_scheduler_jobs;" returns no rows. It works ok in version 1.5.5.
    Edited by: User65423 on Feb 8, 2010 9:24 AM

    Refer to this thread, where the cause seems to be due to SQL Developer not handling null interval data types.
    bug? F9 gives no output dba_scheduler_jobs, version: 2.1.0.63.73
    As mentioned in that thread you can use to_char on the interval columns as a work-around...
    SELECT source,
    destination,
    comments,
    flags,
    job_name,
    job_creator,
    client_id,
    global_uid,
    program_owner,
    program_name,
    job_type,
    job_action,
    number_of_arguments,
    schedule_owner,
    schedule_name,
    start_date,
    repeat_interval,
    end_date,
    job_class,
    enabled,
    auto_drop,
    restartable,
    state,
    job_priority,
    run_count,
    max_runs,
    failure_count,
    max_failures,
    retry_count,
    last_start_date,
    TO_CHAR(last_run_duration),
    next_run_date,
    TO_CHAR(schedule_limit),
    TO_CHAR(max_run_duration),
    logging_level,
    stop_on_window_close,
    instance_stickiness,
    system,
    job_weight,
    nls_env
    FROM user_scheduler_jobs a;

  • BEx query with keyfigure rank in row, chars and other keyfigures in columns

    Hi All,
        I have a BEx query with Plant and Region in rows and two keyfigures(% and rank calculation) in the column. Now my requirement is to display rank in the first column, plant and % cal. in the next columns in query output.
    Query ouput should look like :
    rank plant  %
    1     XYZ    63.00
      2    ABC   76.94 and soon.
    Is any way possible to achieve this and if yes can anyone explain in detail with steps, I apprecaite your help with points.
    Thanks
    Eric.

    Hi  Jerome,
       Thanks for quick response, is there any alternate way like customer exits or etc. This is my requirement and I need to provide the users the solution. I appreciate your valuable time.
    Regards
    Eric

  • Simple query with like return wrong result

    Hi,
    I run simple query with like.
    If I use parameter I get wrong results.
    If I use query without parameter results are ok.
    My script:
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    -- drop table abcd;
    create table abcd (col1 varchar2(10));
    INSERT INTO ABCD VALUES ('122222');
    insert into abcd values ('111222');
    SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
    COL1
    122222
    *111222*
    select * from abcd where col1 like '12%'; -- result ok
    COL1
    122222
    I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    and query run in Oracle SQL Developer 3.1.07.

    Hi,
    welcome to the forum.
    When you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should specify exactly how you run your code.
    If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
    Session altered.
    SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    Session altered.
    SQL>
    SQL> -- drop table abcd;
    SQL> create table abcd (col1 varchar2(10));
    Table created.
    SQL>
    SQL> INSERT INTO ABCD VALUES ('122222');
    1 row created.
    SQL> insert into abcd values ('111222');
    1 row created.
    SQL>
    SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
    SP2-0552: Bind variable "1" not declared.
    SQL>
    I got this error. So I wonder how you set value 12%
    Please specify exactly how you run your test as we cannot reproduce your problem.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SQL query with parameter returns empty result set, please help !!!

    Hi there,
    When I use the following query :
    <sql:query var="beroepsthemas" >
    select *
    from beroepsthemas
    where beroepsthemaid = ?
    <sql:param value="12"/>
    </sql:query>
    When I want to browse the result set with :
    <c:forEach items="${beroepsthemas.rows}" var="rij">
    it shows no records. But it must return at least one.
    All my jsp pages with sql queries and parameters have the same problem.
    This is all on my test environment. I'm using Ubuntu 5.10, Netbeans5.0, JDK 1.5_06, application runs in Bundeled Tomcat 5.5.9, MySQL 4.1.12, mysql-connector3.1.6
    When the same code is run on the live environment, it works just fine.
    The difference is :
    Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
    What can there be wrong !!

    When the same code is run on the live environment, it
    works just fine.
    The difference is :
    Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
    I didn't catch this. I think you may need to update the database driver.

  • Query with column is null is very slow

    I have a query - select * from grv3que where gq_process_date is null;
    that is very slow when returned 4 records (the table has total 60000 records).
    SQL> desc grv3que
    Name Null? Type
    GQ_ID NOT NULL NUMBER(15)
    GQ_MESSAGE LONG
    GQ_RECEIVE_DATE DATE
    GQ_PROCESS_DATE DATE
    GQ_CONTROL_ID NOT NULL VARCHAR2(20)
    and it has two indexes:
    SQL> select index_name, index_type from dba_indexes where table_name='GRV3QUE';
    INDEX_NAME INDEX_TYPE
    PK_GRV3QUE NORMAL
    IDX_GQ_PROCESS_DATE NORMAL
    Analyzing the table/indexes didn't help on the performance.
    Could you help us how to tune the query? Thanks in advance!!!

    DOM@DOM11gR1>create table t1
      2  as
      3  select rownum col1
      4  ,      case when mod(rownum,250000) = 0 then null else sysdate end col2
      5  from   dual
      6  connect by rownum <= 1000000;
    Table created.
    Elapsed: 00:00:02.03
    DOM@DOM11gR1>
    DOM@DOM11gR1>create index i_t1_1 on t1 (col2);
    Index created.
    Elapsed: 00:00:01.03
    DOM@DOM11gR1>
    DOM@DOM11gR1>explain plan for
      2  select *
      3  from   t1
      4  where  col2 is null;
    Explained.
    Elapsed: 00:00:00.02
    DOM@DOM11gR1>
    DOM@DOM11gR1>select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    28 |   616 |   696   (2)| 00:00:09 |
    |*  1 |  TABLE ACCESS FULL| T1   |    28 |   616 |   696   (2)| 00:00:09 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter("COL2" IS NULL)
    Note
       - dynamic sampling used for this statement
    17 rows selected.
    Elapsed: 00:00:00.01
    DOM@DOM11gR1>
    DOM@DOM11gR1>select nvl2(null,1,2), nvl2('X',1,2) from dual;
    NVL2(NULL,1,2) NVL2('X',1,2)
                 2             1
    Elapsed: 00:00:00.01
    DOM@DOM11gR1>
    DOM@DOM11gR1>create index i_t1_2 on t1 (nvl2(col2,null,1));
    Index created.
    Elapsed: 00:00:00.07
    DOM@DOM11gR1>
    DOM@DOM11gR1>explain plan for
      2  select *
      3  from   t1
      4  where  nvl2(col2,null,1) = 1;
    Explained.
    Elapsed: 00:00:00.00
    DOM@DOM11gR1>
    DOM@DOM11gR1>select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2708798483
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |    28 |   616 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1     |    28 |   616 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | I_T1_2 |  4596 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       2 - access(NVL2("COL2",NULL,1)=1)
    Note
       - dynamic sampling used for this statement
    18 rows selected.
    Elapsed: 00:00:00.02
    DOM@DOM11gR1>select *
      2  from t1
      3   where  nvl2(col2,null,1) = 1;
          COL1 COL2
        500000
        750000
       1000000
        250000
    Elapsed: 00:00:00.01
    DOM@DOM11gR1>

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

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

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

  • SQL-Query with JDBC returns error ORA-00600

    Hi,
    I try to execute a SQL-Query using JDeveloper 3.2.3 and the Oracle JDBC-Library 8.1.7
    The following statement
    'ResultSet rset=stmt.executeQuery(SQL-String);'
    where stmt is Statement returns a Database-Error
    ORA-00600 with the Arguments [ttcgcshnd-1], [0] [], [], [], [], [], []
    when the SQL-String queries Varchar2 or CHAR-Columns.
    The Query returns correct values for numeric fields.
    The Database-Server is running on Oracle 9i
    Does anybody know, what could be the reason?
    Thanks, Harold

    I found many forums about it also, but I still haven't got solution yet.
    They talk about the cause, and report to oracle group and so on,
    but I still don't know how to solve my problem and how to enable my oracle 9i jdbc driver working.
    Need help please

  • Query with totals in last row

    Hi All,
    My query below works well for my purpose of showing open deliveries and info, however It does not display drill down arrows because I am using UNION operator.
    For Browse does not work.
    Could anyone help/advise me on any other options or methods to achieve a similar result with drill downs?
    SELECT T0.[DocNum], T0.[DocDate], T0.[DocTotal], T0.[GrosProfit],
    ((T0.[GrosProfit] / (T0.[DocTotal] - T0.[GrosProfit]))*100) As 'Profit %', T1.[CardCode], T1.[CardName],
    T0.[NumAtCard], T2.[GroupName], T1.[Phone1], T1.[CntctPrsn]
    FROM ODLN T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode INNER JOIN OCRG T2 ON
    T1.GroupCode = T2.GroupCode WHERE T0.[DocStatus] ='O'
    UNION
    SELECT NULL, NULL, SUM(T0.[DocTotal]), SUM(T0.[GrosProfit]), NULL, NULL, NULL, NULL, NULL, NULL, NULL
    FROM ODLN T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode INNER JOIN OCRG T2 ON
    T1.GroupCode = T2.GroupCode WHERE T0.[DocStatus] ='O'
    ORDER by T0.[DocNum] desc
    Many thanks,
    John

    Hi,
    you want Link Button to masters data or to particular column?
    Regards,
    Bhavank

  • JPA, Toplink, Query with getSingleResult returns Vector, should it?

    I don't understand why when I do a simple query "Select count(*) From ...." and get use the EntityManager my code is something like this:
    getEntityManager().createNativeQuery(sql).getSingleResult()
    and what I get is a Vector object that has inside a BigDecimal object. I wonder how portable this is if I use hibernate. I bought a book that was written by a couple of guys from Oracle and their example returns a Object array instead of a Vector even when getResultList() function is called.
    I can't find any documentation where it indicates what is returned from getSingleResult() and getResultList().
    Any help from any gurus are most welcomed....

    Bug 2219 (https://glassfish.dev.java.net/issues/show_bug.cgi?id=2219 ) deals with native queries not returning the correct types unless it is to return an entity or results specified using a ResultRetMapping.
    Michael's blog examples are all using JPQL which do not have this problem, so you could switch to using JPQL to get the proper results as well.
    Best Regards,
    Chris

Maybe you are looking for

  • Report Painter (Message no. KH206)

    Hi Experts, I'm having problem in designing a report using report painter KE35. When i try to use formula containing some constant value; system throws following message: Element CM  is not defined correctly -> check definition Message no. KH206 Diag

  • Documentation for custom event listeners

    Hi, I am searching in portal 8.1 documents for using custom events, coding and registering event listeners, and using them in jsp pages. So far my search has been unsuccessful. Can some one let me know where i find this info? -thanks

  • WAD : Changing Web Item Property

    Hi I have a requirement to change the Web item Info Field in WAD 7.0 (earlier Text Element in BW 3.5). Presentlt there are two property that is Width in Pixel & Height in Pixel i want to have Width in Pixel , Full Width , Height in Pixel & Full Heigh

  • IPhoto keeps quitting

    iPhoto keeps quitting on me. I can't even add a new album and it quits. I've tried every remedy that I know of to solve the problem: 1. Rebuild library 2. Memory test 3. Reinstall 4. New library Does anybody know how to solve this? This is what the r

  • Thunderbird will only open on one local folder. No other window, no access to accounts. Reinstalling doesn't help.

    I have 4 accounts and about 30 local folders. Thunderbird is stuck with one local folder open. Cannot access any other page, or any accounts. Reinstalling does not help, nor does restarting the computer. I have Thunderbird 31.5.0 on Yosemite 10.10.2.