Problem with timestamp in query

I have problem with timestamp in JPA query.
I wonna select all data from database where difference between two timestamps is more than 3 month.
Database:
ID timestamp1 timestamp2
1 20008-11-19 15:02000 20008-08-19 15:02000
2 20008-11-19 15:02000 20008-11-14 15:02000
@Column(name = "timestamp1", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
public Date timestamp1;
@Column(name = "timestamp2", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
public Date timestamp2;
sql query works:
select id from table where
MONTH( DATE(timestamp1) - DATE(timestamp2) ) > 3
but how I can write in Java?
I't doesnt wrk:
Query query = em.createQuery("SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3 ")
error:
ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method .
Exception data: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter 'SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3'.
Error message: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException: Encountered "MONTH (" at character 438, but expected: ["(", "+", "-", ".", ":", "", "=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1645)

The error is indocating improper formatting of your JPQL string. MONTH is not understood. I would recommend using your SQL string in a createNativeQuery(...) call instead.
Doug

Similar Messages

  • Problems with Input Ready Query

    Hello All,
    I'm facing problems with input ready query for BI IP.
    I've created the input query on aggregation level and maintianed all the planning settings.  It is not allowing me to edit, when i'm attaching in the web template.
    I also attached a button copy function, and i'm able to execute it and save it, but it not allowing me to change manually.
    I also enabled the 3rd option for keyfigures...data can be changed with planning functions and user input.
    Please help me in this regard.
    We have just started the development of BI-IP, please suggest me if there are any notes to be applied.
    Regards
    Kumar

    Hello Johannes,
    Yes I've set to the finest granularity...even if it is Only one characteristic and one key figure without any restrictions...
    I've checked even planning tab page under properties...it is also fine..
    But still it is not allaowing me to go to edit mode...this is a fresh instalation and the query i'm working is the first one...
    Please suggest me if there are any notes to be applied, we are on Support Pack 10.
    Regards
    Jeevan Kumar

  • Problem with unit in Query

    Hallo Experts,
    We encounter a problem with unit in our Query.
    Szenario:
    We use the Unit like PC, SET in Query.
    In Table T006 those Units have value 0 in the field ANDEC, so they will be rounded up and rounded down in Query.
    Our Problem is some Queries need the rounding up and down but others don't need this function.
    Where and how should we change to solve the problem.
    thanks & Best regards

    hi,
    if you want to control the rounding off while unit conversion you can do it from SPRO
    In the BW system, goto SPRO -> SAP NetWeaver -> General Settings -> Check Units of Measurement -> Units of Measurement -> Choose the unit corresponding to 'KM' -> Click on 'Details' button in the toolbar.
    Look the field 'Decimal Pl rounding'. Change this to 3 or whatever value you choose and see if it works.
    in above link i have taken example of KM, you need need to select the required unit.
    let us know if this is solves your problem. I am not sure if this can be done for individual queries but this is controlled by UOM wise as mentioned above.
    Regards,
    Rk.

  • Problem with a Bex Query Report with Web Intelligence

    Hello!
    I have a Bex query (with query Bex version 7.0) I'm connecting with Web Intelligence (4.0) but one of the attributes instead of displaying the description shows only the key, and it is strange because other cubes if given by the conversion.
    I wonder if there is a solution for this or if it is a problem of version 4.0 of Web Intelligence.
    I await your response,
    Greetings!

    Hi,
    Whereabouts in the application are you seing this problem?  (in the query panel conditions, in the prompt list of values, or in the table block? )
    also, what do you mean by "and it is strange because other cubes if given by the conversion" ?
    it's worth noting that the "key and text display properties" in the Bex Query Designer do not influence webi.  WebI consumes the global infoobject property from BW RSH1.
    Regards,
    H
    p.s. if you need to understand which features are or are not supported with BI 4.0 tools, please look here: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d056e1bc-2794-2e10-959e-8779c5623cc5

  • Problem with REGEXP_SUBSTR related query.

    I am having a problem with this query:
    SELECT *
      FROM (    SELECT REGEXP_SUBSTR ('{SUMMER}|{POINT OF SALE}',
                                               '({)([A-Z]+ *[A-Z]*)(})',
                                               1,
                                               LEVEL,
                                               'i',
                                               2)
                                   val
                  FROM DUAL
            CONNECT BY LEVEL <=
                          REGEXP_COUNT ('{SUMMER}|{POINT OF SALE}', '|') + 1)
    WHERE val IS NOT NULL
    I need the output in 2 rows in this format:
    VAL
    ====
    SUMMER
    POINT OF SALE
    But I am not able to get 'POINT OF SALE' in the output because of the blank space, or maybe some other reason. Can anyone correct my query?

    So you want something like this?
    SQL> ed
    Wrote file afiedt.buf
      1  SELECT *
      2    FROM (    SELECT REGEXP_SUBSTR ('{SUMMER}|{POINT OF SALE}', '[^{|}]+', 1, LEVEL, 'i') val
      3                FROM DUAL
      4          CONNECT BY LEVEL <=
      5                        REGEXP_COUNT ('{SUMMER}|{POINT OF SALE}', '[^|]+'))
      6*  WHERE val IS NOT NULL
    SQL> /
    VAL
    SUMMER
    POINT OF SALE
    SQL>

  • Problem with Timestamp

    Hi
    I am using Oracle 10.1.0.4. When I am storing events with the received
    timestamps, it stores in GMT. But I am calling the stored procedure
    with timestamp in IST. Similarly when I search for that using IST, It
    returns the results matching the corresponding GMT. If I search 6.30 AM
    IST, It returns results for 1.00 AM.
    Appreciate your help

    What kind of timestamp datatype?
    How are timestamps "received" and stored?
    Time zone settings (sessions and database)?
    SQL> drop table tider;
    Table dropped.
    SQL> create table tider (t1 timestamp with time zone, t2 timestamp with local time zone);
    Table created.
    SQL> select sessiontimezone from dual;
    SESSIONTIMEZONE
    -05:00
    SQL> insert into tider values ('1-jul-6 1:0:0 pm','1-jul-6 1:0:0 pm');
    1 row created.
    SQL> select * from tider;
    T1
    T2
    01-JUL-06 01.00.00.000000 PM -05:00
    01-JUL-06 01.00.00.000000 PM
    SQL> alter session set time_zone='Europe/Stockholm';
    Session altered.
    SQL> select * from tider where t1='1-jul-6 8:0:0 pm CET';
    T1
    T2
    01-JUL-06 01.00.00.000000 PM -05:00
    01-JUL-06 08.00.00.000000 PM
    Is this same as what you are seeing?

  • Problem with Counter in Query

    Hi Experts,
    There is a problem in my query output.
    I have a CKF for sales documents number created with replacement path which gives the correct count of number of Sales documents.
    But the req here is to create two more counters which will be counting the passed and failed count with reference to other KF1 (the value of this KF can be 0 or 1).
    i.e. If the KF1 value is then failed count would be 1 .
           else passed count would be 1.
    I have used the Replcement path variable created for Sales Document count.
    For failed count the CKF formula which I have created is: (Sales Order Count ) * (KF1<>1)
    Which gives the right result but as soon as I remove the drill down , instead of aggrading the total results, failed counter still shows 1 which is incorrect.
    Could any one please help me out.
    Regards,
    BW User

    hello,
    try using exception aggregation as total and reference char as the one which u have reomved from drilldown.
    Regds,
    Shashank

  • How can i use index in select query.. facing problem with the select query.

    Hi Friends,
    I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.
    Here is the query:
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelat LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelatrprctr
        WHERE rldnr  = c_telstra_accounting
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          And rzzlstar in r_lstar                            
          AND rpmax  = c_max_period.
    There are 5 indices present for Table ZTFTELAT.
    Indices of ZTFTELAT:
      Name   Description                                               
      0        Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)                                          
      005    Profit (RCLNT,RPRCTR)
      1        Ledger, company code, account (RLDNR,RBUKRS, RACCT)                                
      2        Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)                           
      3        Account, cost center (RACCT,RCNTR)                                        
      4        RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR                        
      Z01    Activity Type, Account (RZZLSTAR,RACCT)                                        
      Z02    RYEAR-RBUKRS- RZZZBER-RLDNR       
    Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?
    Thanks in advance.

    Hi Shiva,
    I am using two more select queries with the same manner ....
    here are the other two select query :
    ***************1************************
    SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelpt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelptrprctr
        WHERE rldnr  = c_telstra_projects
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar             
          AND rpmax  = c_max_period.
    and the second one is
    *************************2************************
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelnt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelntrprctr
        WHERE rldnr  = c_telstra_networks
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar                              
          AND rpmax  = c_max_period.
    for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables.  if i will not use it will delete all the data fetched earlier.
    Thanks on advanced......
    Sourabh

  • Problem with Variable in Query Designer.

    hi all,
    we have a variable ZAMREG on characteristic AM Region, where AM region is attribute for two different master data objects mastobj1 and mastobj2, we have different infosets build on these two master data objects along with some other ODS.
    now this variable ZAMREG is visible in one of the infosets only in query designer, whereas it is not visible in the other infoset.
    what could be the problem??
    thanks,
    Rk

    Hi,
    Please check if that variable is created locally or globally. If it is a local variable in any query, it will not appear in any other query.
    In anyways, you can always create one more variable if the older one is not available. This will not make much of difference. I would suggest go ahead with creating a new variable.
    Regards,
    Yogesh

  • Mapping Problem with Native SQL query

    My application uses a native SQL query to locate certain entities. It looks like this:
    SELECT UPLOADATTEMPTREF, STUDENTNUMBER, USERID, WORKITEMCODE, WORKITEMINSTURN, WORKITEMTITLE, MODULERUNCODE, STUDENTNAME, SUBMISSIONDEADLINE, UPLOADATTEMPTSERVERDATE, FILENAME, UPLOADCOMPLETESERVERDATE, NEWFILENAME, FILESIZE, FILEPATH, DOWNLOADSERVERDATE, MODULECODE, MODULETITLE
    FROM Submission_Attempt WHERE UPLOADATTEMPTREF IN (
    SELECT uploadAttemptRef FROM (" +<br /><br />                         "SELECT MAX(uploadAttemptRef) AS uploadAttemptRef, UserID, workItemInstUrn, " +<br /><br />                         "workItemCode FROM Submission_Attempt where workiteminsturn = ?1 " +<br /><br />                         "GROUP BY UserID, workItemInstUrn, workItemCode) Table1 ) " +<br /><br />                         "and uploadCompleteServerDate is not null;"<br />
    My expectation was that EclipseLink would be able to handle the mapping of the results to the entity quite happily. However, I get a NonSynchronizedVector of Objects - each Object representing one field of data.
    I need help with either:
    Converting the above SQL into JPQL so that I (hopefully) don't have to worry about the SQL or
    Understanding why this isn't working properly...
    Anyone able to help?
    Edited by: phunnimonkey on Nov 6, 2008 3:33 AM

    Never mind - the problem was to do with not specifying a class when creating the native query.

  • Problems with VO's query, clause: QRSLT

    Hi Gurus,
    I got a problem here with a vo's query, the query its fine running in sqldeveloper and toad, but when I ran it on VO's the query doesn't show me any result, what can I do to fix this problem?
    Please, I hope you can help me with this one, I'll be pending to your answer.
    Heres the query that runs fine in sqldeveloper or toad and returns me a lot of results
    SELECT ss.actual_sin, ss.idsin
    FROM xx.xx_seg_ctrl_da d
    INNER JOIN xx.xx_seg_sin ss
    ON (ss.idsin = d.idsin)
    WHERE d.status = 0 AND ss.idsin IN ('102_d','487_b','101_m','201_d')
    ORDER BY DECODE(ss._ACTUAL_SIN, 'RED','a', 'YELLOW','b','GREEN','c')
    and here's the query when run on the VO's component and doesn't return any result
    SELECT * FROM (SELECT ss.actual_sin, ss.idsin
    FROM xx.xx_seg_ctrl_da d
    INNER JOIN xx.xx_seg_sin ss
    ON (ss.idsin = d.idsin)
    WHERE d.status = 0
    ORDER BY DECODE(ss._ACTUAL_SIN, 'RED','a', 'YELLOW','b','GREEN','c')) QRSLT WHERE IDSIN IN ('102_d','487_b','101_m','201_d')
    have a nice one.
    Best Regards,
    mentor

    the second query is for rowcount. Enable the logger and see what value is getting passed as bind variable.

  • Performance problem with relatively simple query

    Hi, I've a statement that takes over 20s. It should take 3s or less. The statistics are up te date so I created an explain plan and tkprof. However, I don't see the problem. Maybe somebody can help me with this?
    explain plan
    SQL Statement which produced this data:
      select * from table(dbms_xplan.display)
    PLAN_TABLE_OUTPUT
    | Id  | Operation               |  Name              | Rows  | Bytes |TempSpc| Cost  |
    |   0 | SELECT STATEMENT        |                    | 16718 |   669K|       | 22254 |
    |   1 |  SORT UNIQUE            |                    | 16718 |   669K|    26M| 22254 |
    |   2 |   FILTER                |                    |       |       |       |       |
    |*  3 |    HASH JOIN            |                    |   507K|    19M|       |  9139 |
    |   4 |     TABLE ACCESS FULL   | PLATE              | 16718 |   212K|       |    19 |
    |*  5 |     HASH JOIN           |                    |   507K|    13M|  6760K|  8683 |
    |*  6 |      HASH JOIN          |                    |   216K|  4223K|       |  1873 |
    |*  7 |       TABLE ACCESS FULL | SDG_USER           |  1007 |  6042 |       |     5 |
    |*  8 |       HASH JOIN         |                    |   844K|    11M|       |  1840 |
    |*  9 |        TABLE ACCESS FULL| SDG                |  3931 | 23586 |       |     8 |
    |  10 |        TABLE ACCESS FULL| SAMPLE             |   864K|  6757K|       |  1767 |
    |* 11 |      TABLE ACCESS FULL  | ALIQUOT            |  2031K|    15M|       |  5645 |
    |  12 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    |  13 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    |  14 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    |  15 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    Predicate Information (identified by operation id):
       3 - access("SYS_ALIAS_2"."PLATE_ID"="SYS_ALIAS_1"."PLATE_ID")
       5 - access("SYS_ALIAS_3"."SAMPLE_ID"="SYS_ALIAS_2"."SAMPLE_ID")
       6 - access("SYS_ALIAS_4"."SDG_ID"="SDG_USER"."SDG_ID")
       7 - filter("SDG_USER"."U_CLIENT_TYPE"='QC')
       8 - access("SYS_ALIAS_4"."SDG_ID"="SYS_ALIAS_3"."SDG_ID")
       9 - filter("SYS_ALIAS_4"."STATUS"='C' OR "SYS_ALIAS_4"."STATUS"='P' OR "SYS_ALIA
                  S_4"."STATUS"='V')
      11 - filter("SYS_ALIAS_2"."PLATE_ID" IS NOT NULL)
    Note: cpu costing is off
    tkprof
    TKPROF: Release 9.2.0.1.0 - Production on Mon Sep 22 11:09:37 2008
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Trace file: d:\oracle\admin\nautp\udump\nautp_ora_5708.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    alter session set sql_trace true
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    SELECT distinct p.name
    FROM lims_sys.sdg sd, lims_sys.sdg_user sdu, lims_sys.sample sa, lims_sys.aliquot a, lims_sys.plate p
    WHERE sd.sdg_id = sdu.sdg_id
    AND sd.sdg_id = sa.sdg_id
    AND sa.sample_id = a.sample_id
    AND a.plate_id = p.plate_id
    AND sd.status IN ('V','P','C')
    AND sdu.u_client_type = 'QC'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.09       0.09          0          3          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      7.67      24.63      66191      78732          0         500
    total        3      7.76      24.72      66191      78735          0         500
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    Rows     Row Source Operation
        500  SORT UNIQUE
    520358   FILTER 
    520358    HASH JOIN 
      16757     TABLE ACCESS FULL PLATE
    520358     HASH JOIN 
    196632      HASH JOIN 
       2402       TABLE ACCESS FULL SDG_USER
    834055       HASH JOIN 
       3931        TABLE ACCESS FULL SDG
    864985        TABLE ACCESS FULL SAMPLE
    2037373      TABLE ACCESS FULL ALIQUOT
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
    select 'x'
    from
    dual
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          3          0           1
    total        3      0.00       0.00          0          3          0           1
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    Rows     Row Source Operation
          1  TABLE ACCESS FULL DUAL
    begin :id := sys.dbms_transaction.local_transaction_id; end;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0         12          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0         12          0           1
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      0.09       0.09          0          3          0           0
    Execute      4      0.00       0.00          0         12          0           1
    Fetch        2      7.67      24.63      66191      78735          0         501
    total        9      7.76      24.72      66191      78750          0         502
    Misses in library cache during parse: 3
    Misses in library cache during execute: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       48      0.00       0.00          0          0          0           0
    Execute     54      0.00       0.01          0          0          0           0
    Fetch       65      0.00       0.00          0        157          0          58
    total      167      0.00       0.01          0        157          0          58
    Misses in library cache during parse: 16
        4  user  SQL statements in session.
       48  internal SQL statements in session.
       52  SQL statements in session.
    Trace file: d:\oracle\admin\nautp\udump\nautp_ora_5708.trc
    Trace file compatibility: 9.00.01
    Sort options: default
           1  session in tracefile.
           4  user  SQL statements in trace file.
          48  internal SQL statements in trace file.
          52  SQL statements in trace file.
          20  unique SQL statements in trace file.
         500  lines in trace file.Edited by: RZ on Sep 22, 2008 2:27 AM

    A few notes:
    1. You seem to have either a VPD policy active or you're using views that add some more predicates to the query, according to the plan posted (the access on the PK_OPERATOR_GROUP index). Could this make any difference?
    2. The estimates of the optimizer are really very accurate - actually astonishing - compared to the tkprof output, so the optimizer seems to have a very good picture of the cardinalities and therefore the plan should be reasonable.
    3. Did you gather index statistics as well (using COMPUTE STATISTICS when creating the index or "cascade=>true" option) when gathering the statistics? I assume you're on 9i, not 10g according to the plan and tkprof output.
    4. Looking at the amount of data that needs to be processed it is unlikely that this query takes only 3 seconds, the 20 seconds seems to be OK.
    If you are sure that for a similar amount of underlying data the query took only 3 seconds in the past it would be very useful if you - by any chance - have an execution plan at hand of that "3 seconds" execution.
    One thing that I could imagine is that due to the monthly data growth that you've mentioned one or more of the tables have exceeded the "2% of the buffer cache" threshold and therefore are no longer treated as "small tables" in the buffer cache. This could explain that you now have more physical reads than in the past and therefore the query takes longer to execute than before.
    I think that this query could only be executed in 3 seconds if it is somewhere using a predicate that is more selective and could benefit from an indexed access path.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Problem with Broadcasting Web query

    I am able to broadcast the web query and I recieve the email in MS Outlook, but the report is unreadable. It has the proper header info (from, to, subject, ...), but the report itself shows up as garbled text ("Q29udGVudC1UeXBlOiBtdWx0aXBhcnQvcmVsYXRlZDsNCiBib3VuZG").
    I tried the different output formats in Broadcaster, but no luck. Anyone else experience this?
    Thanks in advance.

    Check the o/p of the sent mail from tcode SOST. if the o/ format looks fine in SOST, the problem could be on the Mail server (Exchange or Lotus notes).
    What version of MS Outlook/ MSExchange server are you using? I have seen issues with MS Exchange 2002>.
    Thanks.

  • Database toolkit & Oracle 11g, problem with timestamps

    I tested my application, based on the Database toolkit, with Access and Oracle XE (10g) databases and all was ok. After moving my database to a Oracle 11g server, i get this error for any query involving a TIMESTAMP WITH TIME ZONE or TIMESTAMP WITH LOCAL TIME ZONE column:
    ADO Error: 0x80040E21
    Exception occured in Microsoft OLE DB Provider for ODBC Drivers: ODBC driver does not support the requested properties.
    The error is raised by the "Execute" invoke node in "DB Tools execute query.vi".
    Using Labview 2009 and up to date Oracle ODBC drivers on Windows XP

    Hi SnamProgetti,
    I don't have any useful information about this error. You can try to read this and this document.
    Have a nice day,
    Simone S.
    Academic Field Engineer - Med Region

  • Problems with timestamps

    Hello everybody,
    and here is my problem for this day ;-).
    I am trying to use a timestamp which comes from an database entry.
    The data type in the database is timestamp and the entries are looking
    like this 2002-06-19 09:22:19.238805. My question is now
    how to use this timestamp in Java. I have tried to use new Timestamp(..) so far, but either I use the deprecated constructor or a constructor with the timestamp in milliseconds after 1970. But I don't have the milliseccons and using the first mentioned constructor isn't that productiv.
    It would be perfect if I could use the generated date for a date navigator as well.
    Has anyone a solution?
    Best regards
    Joachim

    Hi,
    In database it will always display you as a String you told,  but when you fetch it the return type will always be java.sql.TimeStamp or java.sql.Date.
    so You can use the my method of using it.
    Otherwise you have to read the strings and create the date... which a wrong way of doing it ,because all methods are deprecated.
    REgards,
    Praveen

Maybe you are looking for

  • Need to repair disk but dvd is broke

    hi. despite using logic9 and ableton8 extensively for some years my actual knowledge of computers and the os is shameful just to warn you ive often done "repair permissions" but was told to do disk repair also from time to time, so i did the verify d

  • Error with movies in Quicktime

    I cannot see any movie in this computer. I've played them in another mac and they run well. They are in .avi and my quicktime only says that there is an error and that i might need to downoad something from the quicktime page but it does not say what

  • Trouble upgrading to Busy Cal 2?

    I have been trying for a week to upgrade from version 2.5.4 to Busy Cal 2  version 2.6 on the Mac App Store and it is not working. I get error sign messages that the Store is having trouble (try again later) or just nothing happens.  Busy Cal Support

  • I wasn't able to download the CS6 Master trial version.

    What can I do next?

  • User forgot passcode, now what?

    OK, it probably sounds like a stupid question, but I think it is a catch 22. Using Profile Manager, I manage 30 or so iPads for our enterprise. The SSID/Network info is delivered to each device via profiles, so the end user never knows the network se