Query to tabulate AWR data

Here is what I would like to do:
I want to take the 'redo size' statistic (or any arbitrarily-chosen statistic) from
DBA_HIST_SYSSTAT and arrange the values into hourly columns. In other words,
each row would represent a day of data and the columns represent each hour of the
day.
So basically I would like to take the data from this query:
col val form 999999999999999
break on day
select to_char(a.begin_interval_time,'yy/mm/dd') day,
to_char(a.begin_interval_time,'HH24') hour,
sum(nvl(b.value,0)) val
from dba_hist_snapshot a, dba_hist_sysstat b
where a.snap_id = b.snap_id(+)
and b.stat_name='redo size'
and a.begin_interval_time between sysdate-1 and sysdate
group by to_char(a.begin_interval_time,'yy/mm/dd'), to_char(a.begin_interval_time,'HH24')
order by to_char(a.begin_interval_time,'yy/mm/dd'), to_char(a.begin_interval_time,'HH24')
/...which looks like this:
DAY      HO              VAL
07/10/02 00    1036131644036
         01    1037530765652
         02    1038571691928
         03    1039399200220
         04    1040275896412
         05    1041459201832
         06    1041859052276
         07    1041935101996
         08    1042008555356
         09    1042054762740
         10    1044215211244
         11    1046748716244
         12    1049814232712
         13    1050980526364
         14    1052483873572
         15    1053777104332
         16    1055565006700
         17    1056234462012
         18    1057555905384
         19    1058137166480
         20    1058585524224
         21    1058653399424
         22    1058685012560
         23    1059050344768...and make it look like this:
          00            01            02            03            04            05            06            07            08            09            10            11            12            13            14            15            16            17            18            19            20            21            22            23
07/10/02  1036131644036 1037530765652 1038571691928 1039399200220 1040275896412 1041459201832 1041859052276 1041935101996 1042008555356 1042054762740 1044215211244 1046748716244 1049814232712 1050980526364 1052483873572 1053777104332 1055565006700 1056234462012 1057555905384 1058137166480 1058585524224 1058653399424 1058685012560 1059050344768 Can anyone nudge me in the right direction?

As is often the case, having asked the question, the
solution magically appears. I must have been sick the
day we covered ''decode'' in Oracle School. Here is one
solution to my question:
select
  to_char(a.begin_interval_time,'yy/mm/dd') day,
  sum(decode(to_char(a.begin_interval_time,'HH24'),'00', nvl(b.value,0))) "00",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'01', nvl(b.value,0))) "01",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'02', nvl(b.value,0))) "02",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'03', nvl(b.value,0))) "03",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'04', nvl(b.value,0))) "04",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'05', nvl(b.value,0))) "05",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'06', nvl(b.value,0))) "06",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'07', nvl(b.value,0))) "07",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'08', nvl(b.value,0))) "08",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'09', nvl(b.value,0))) "09",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'10', nvl(b.value,0))) "10",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'11', nvl(b.value,0))) "11",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'12', nvl(b.value,0))) "12",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'13', nvl(b.value,0))) "13",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'14', nvl(b.value,0))) "14",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'15', nvl(b.value,0))) "15",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'16', nvl(b.value,0))) "16",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'17', nvl(b.value,0))) "17",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'18', nvl(b.value,0))) "18",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'19', nvl(b.value,0))) "19",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'20', nvl(b.value,0))) "20",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'21', nvl(b.value,0))) "21",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'22', nvl(b.value,0))) "22",
  sum(decode(to_char(a.begin_interval_time,'HH24'),'23', nvl(b.value,0))) "23"
  from dba_hist_snapshot a, dba_hist_sysstat b
  where a.snap_id = b.snap_id(+)
  and b.stat_name='redo size'
  and a.begin_interval_time between sysdate-2 and sysdate
  group by to_char(a.begin_interval_time,'yy/mm/dd')
  order by to_char(a.begin_interval_time,'yy/mm/dd')
/

Similar Messages

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • Query to get the data of all the columns in a table except any one column

    Can anyone please tell how to write a query to get the data of all the columns in a table except one particular column..
    For Example:
    Let us consider the EMP table.,
    From this table except the column comm all the remaining columns of the table should be listed
    For this we can write a query like this..
    Select empno, ename, job, mgr, sal, hiredate, deptno from emp;
    Just to avoid only one column, I mentioned all the remaining ( 7 ) columns of the table in the query..
    As the EMP table consists only 8 columns, it doesn't seem much difficult to mention all the columns in the query,
    but if a table have 100 columns in the table, then do we have to mention all the columns in the query..?
    Is there any other way of writing the query to get the required result..?
    Thanks..

    Your best best it to just list all the columns. Any other method will just cause more headaches and complicated code.
    If you really need to list all the columns for a table because you don't want to type them, just use something like...
    SQL> ed
    Wrote file afiedt.buf
      1  select trim(',' from sys_connect_by_path(column_name,',')) as columns
      2  from (select column_name, row_number() over (order by column_id) as column_id
      3        from user_tab_cols
      4        where column_name not in ('COMM')
      5        and   table_name = 'EMP'
      6       )
      7  where connect_by_isleaf = 1
      8  connect by column_id = prior column_id + 1
      9* start with column_id = 1
    SQL> /
    COLUMNS
    EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO
    SQL>

  • Query based on a date range

    I want to query based on a date range. I wrote the following EJB QL:
    "select object(a) from ActionItems as a where a.dueDate
    between ?1 and ?2"
    But when I deployed the application to Oracle's EJB server, I got the following error:
    Auto-deploying biogen.jar (No previous deployment found)... Invalid type for expression (a.dueDate BETWEEN ?1 AND ?2)
    EJB QL statement : 'select object(a) from ActionItems as a where a.dueDate between ?1 and ?2'
    EJB QL method : public abstract java.util.Collection ActionItemsLocalHome.findByDueDateRange(java.sql.Date,java.sql.Date) throws javax.ejb.FinderException
    at com.sun.ejb.ejbql.parser.EjbQLParser.parse EjbQLParser.java:218)
    at com.sun.ejb.ejbql.EjbQLDriver.parse(EjbQLDriver.java:86)
    at com.sun.ejb.sqlgen.SQLGenerator.generateSQLForEjbQLQueries(SQLGenerator.java:704)
    It works fine for a number range, but does not work for a date range.
    Any one has an idea on how to write a correct EJB QL for a query based on date range?
    Thanks.
    Jingzhi

    Re-posted. Please help!

  • Failed to parse SQL query: ORA-01403: no data found

    I'm going to post and answer my own question in the hope that others will not have to struggle with this error.
    Using a report of the type PL/SQL Function Body Returning SQL and using generic columns you may run into this error
    failed to parse SQL query:
    ORA-01403: no data found
    The SQL will run stand alone but the report fails.
    There is a setting just below the source you should check:
    "Maximum number of generic report columns"
    In my case the number of columns was dynamic and when it exceeded the number set as the maximium number of generic columns I received the 1403 error.
    Hope this helps someone.
    Greg

    Thanks for much for the pointer. For anyone else struggling with this too, I found that my generic columns had unordered themselves. Reordering them solved the problem for me.
    Edited by: user11096971 on Jul 22, 2010 3:19 AM

  • Query required to get data

    hi
    i need to a query to get the data as per given structure below.
    tha data should be based on stock code and dates.
    for example : stock_code = 01 and
    from date 01/01/08
    to date 31/01/08
    Date particulars reciepts issued returns closing bal
    01/01/08 opening balance 0
    01/01/08 recieved stock : no 1 18 18
    02/01/08 issued stock : no 5 5 13
    03/01/08 return stock : no 50 3 16
    and so on
    here is the tables i m using
    SQL> desc bal_sheet (balance sheet holds the opening and closing record)
    Name Null? Type
    BDATE DATE
    ACC_CODE VARCHAR2(20)
    OPENBAL NUMBER(20,4)
    CLOSEBAL NUMBER(20,4)
    SQL> desc stock_reg
    Name Null? Type
    STOCKCODE NOT NULL VARCHAR2(20)
    ITEM_CODE VARCHAR2(10)
    DESCR NOT NULL VARCHAR2(50)
    COMCODE VARCHAR2(6)
    COMPANY NOT NULL VARCHAR2(200)
    SHORT_NAME VARCHAR2(10)
    PACK VARCHAR2(10)
    PRICE NUMBER(10,4)
    TOTAL_STOCK NUMBER
    SQL> DESC PURCHASE_HEADER
    Name Null? Type
    P_ID NOT NULL VARCHAR2(10)
    ACC_CODE VARCHAR2(10)
    P_DATE DATE
    REMARK VARCHAR2(500)
    INVOICE_DATE DATE
    NTOTAL NUMBER(12,4)
    SQL> DESC PURCHASE_DETAIL
    Name Null? Type
    STOCKCODE VARCHAR2(20)
    P_ID VARCHAR2(10)
    QTY NUMBER
    BONUS NUMBER
    PRICE NUMBER(15,4)
    EXPIRE_DATE DATE
    DAMAGE NUMBER
    AMOUNT NUMBER(15,4)
    SQL> DESC SALES_HEADER
    Name Null? Type
    S_ID NOT NULL VARCHAR2(8)
    ACC_CODE VARCHAR2(10)
    SALES_MANID VARCHAR2(20)
    S_DATE DATE
    REMARKS VARCHAR2(500)
    NTOTAL NUMBER(12,4)
    SQL> DESC SALES_DETAIL
    Name Null? Type
    S_ID NOT NULL VARCHAR2(8)
    STOCKCODE NOT NULL VARCHAR2(20)
    QTY NUMBER
    BONUS NUMBER
    BATCH_NO NOT NULL VARCHAR2(10)
    EXPIRY_DATE DATE
    AMOUNT NUMBER(15,4)
    SQL> DESC SALES_HEADER
    Name Null? Type
    SR_ID NOT NULL VARCHAR2(8)
    ACC_CODE VARCHAR2(10)
    SALES_MANID VARCHAR2(20)
    S_DATE DATE
    REMARKS VARCHAR2(500)
    NTOTAL NUMBER(12,4)
    SQL> DESC SALES_DETAILR
    Name Null? Type
    SR_ID NOT NULL VARCHAR2(8)
    STOCKCODE NOT NULL VARCHAR2(20)
    QTY NUMBER
    BONUS NUMBER
    BATCH_NO NOT NULL VARCHAR2(10)
    EXPIRY_DATE DATE
    AMOUNT NUMBER(15,4)
    hope the information would be enough to get understand the problem

    Query required to get data Agreed ! Even on your side it is required.
    Well, please, understand we are not here to do your job. So, make effort on your side, show us what you have already done/tried, and post here your results.
    And also, use the tags [pre] and [/pre] around your code against the forum side to keep your post readable.
    Help us to help you,
    Nicolas.

  • The workbook report no authorization, but related query can show part data

    Dear All,
    We meet an error, The workbook report no authorization, but related query can show part data.
    We have a workbook, it have 1 queries, and when we key in condition to run it, in one field we put on one more condition(Z3XXX = ' WZO'  & ' WZA")(User didn't have authorization for this condition),  and workbook report no authorization.
    Then we checked  authorization check log and it show "You do not have sufficient authorization on Z3XXX = ' WCO'.
    But when we execute the related query with same condition. the query can open and show WZA's data.
    I'd like to know the reason.
    thanks & Best Regards,
    Kent Yu

    Dear All,
    We meet an error, The workbook report no authorization, but related query can show part data.
    We have a workbook, it have 1 queries, and when we key in condition to run it, in one field we put on one more condition(Z3XXX = ' WZO'  & ' WZA")(User didn't have authorization for this condition),  and workbook report no authorization.
    Then we checked  authorization check log and it show "You do not have sufficient authorization on Z3XXX = ' WCO'.
    But when we execute the related query with same condition. the query can open and show WZA's data.
    I'd like to know the reason.
    thanks & Best Regards,
    Kent Yu

  • The SharePoint list query is not valid: Data at the root level is invalid. Line 1, position 1. (rsSPDataProviderError)

    Hi there,
    All my reports are throwing below error in a sharepoint site configured with Access services. Does anyone have a clue what's causing it?
    An error has occurred during report processing. (rsProcessingAborted)
     Query execution failed for dataset 'Default'. (rsErrorExecutingCommand)
     The SharePoint list query is not valid: Data at the root level is invalid. Line 1, position 1. (rsSPDataProviderError)
    Thanks
    Manvir

    Hi Manvir,
    For troubleshooting your issue, please go to C:\Inetpub\wwwroot\wss\VirtualDirectories\ find your Web Application (represented by a port number), then delete an unknown folder created by sharepoint, namely vti_cnf from all the folders and sub-folders in
    your web application.
    Reference:
    http://forums.asp.net/t/985790.aspx?Data+at+the+root+level+is+invalid+Line+1+position+1
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • An error has occurred during report processing. (rsProcessingAborted).. Query execution failed for data set

    Hi All,
    I'm facing a strange problem..
    I've developed few reports. they are working fine in develop environment. after successfull testing they were published on web.
    in web version, all reports are executing for first time.. if I change any of parameters values or without chaning also..
    if I press "View Report"  following error occurs..
    An error has occurred during report processing. (rsProcessingAborted)
    Query execution failed for data set 'dsMLGDB2Odbc'. (rsErrorExecutingCommand)
    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    please suggest any alternative ways to overcome this issue
    thanks in adv.

    in my case the problem is
    one virtual machine is for developers
    other for testers
    in developers i created a report, then save like *.rdl and copy to testers machine, does not work there
    the error what testers get is
    Error during the local report processing.
    Could not find a web-based application at http://developersMachine/AnalyticsReports/DataBaseConnector.rsds
    and the solution is to use alternative url or in some cases http://localhost/

  • Ejb datacontrol, query panel with timestamps / date field errors

    Hi,
    I made an ejb datacontrol on a session bean in jdev 11g ps1 and used the named criteria of this entity in the data control to create an af querypanel. This works well.
    first thing I cannot configure a date picker with time on this timestamp field (only date ).( does not matter what I configure in the entity datacontrol xml , it does not work )
    and displaying the timestamp field in a inputData ( result table ) and showing the time also does not work either.
    When I use in the query panel a between query operator on this date or timestamp field I get this error.
    Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1241)
    <BeanDataCollection><invokeMethod> Exception occurred invoking $Proxy179.queryByRange
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.adapter.bean.provider.BeanDataCollection.invokeMethod(BeanDataCollection.java:405)
         at oracle.adf.model.adapter.bean.jpa.JPQLBeanDataCollection.getRecordCount(JPQLBeanDataCollection.java:164)
         at oracle.adf.model.adapter.bean.provider.BeanDataCollection.init(BeanDataCollection.java:153)
         at oracle.adf.model.adapter.bean.jpa.JPQLBeanDataCollection.init(JPQLBeanDataCollection.java:110)
         at oracle.adf.model.adapter.bean.provider.BeanDataCollection.refresh(BeanDataCollection.java:380)
         at oracle.adf.model.adapter.bean.provider.BeanDataProvider.getDataProvider(BeanDataProvider.java:63)
         at oracle.adf.model.adapter.bean.DataFilterHandler.invokeAccessor(DataFilterHandler.java:137)
         at oracle.adf.model.adapter.bean.BeanFilterableDataControl.invokeAccessor(BeanFilterableDataControl.java:78)
         at oracle.adf.model.bean.DCBeanDataControl.invokeAccessor(DCBeanDataControl.java:447)
         at oracle.adf.model.bean.DCDataVO$DCAccessorCollectionAdapter.getDataProvider(DCDataVO.java:2627)
         at oracle.adf.model.bean.DCDataVO$DCAccessorCollectionAdapter.refreshIterator(DCDataVO.java:2519)
         at oracle.adf.model.bean.DCDataVO.executeQueryForCollection(DCDataVO.java:419)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1130)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1299)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1217)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1211)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:6097)
         at oracle.adf.model.bean.DCBeanDataControl.executeIteratorBinding(DCBeanDataControl.java:943)
         at oracle.adf.model.binding.DCIteratorBinding.doExecuteQuery(DCIteratorBinding.java:2147)
         at oracle.jbo.uicli.binding.MyIteratorBinding.executeQuery(JUAccessorIteratorDef.java:717)
         at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.applyAndExecuteViewCriteria(JUSearchBindingCustomizer.java:598)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:424)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1289)
         at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.ejb.EJBException: EJB Exception: ; nested exception is:
         java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82); nested exception is: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:109)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:91)
         at $Proxy179.queryByRange(Unknown Source)
         ... 65 more
    Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT COUNT(o) FROM RunMessages o WHERE (o.processDate BETWEEN '2009-12-11' AND '2009-12-12')], line 1, column 56: syntax error at [BETWEEN].
    Internal Exception: MismatchedTokenException(11!=82)
         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1241)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:93)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
         at $Proxy175.createQuery(Unknown Source)
         at nl.tennet.mhs.console.model.services.MhsConsoleBean.queryByRange(MhsConsoleBean.java:32)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy181.queryByRange(Unknown Source)
         at nl.tennet.mhs.console.model.services.MhsConsole_ssug8i_MhsConsoleImpl.queryByRange(MhsConsole_ssug8i_MhsConsoleImpl.java:218)
         at nl.tennet.mhs.console.model.services.MhsConsole_ssug8i_MhsConsoleImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at nl.tennet.mhs.console.model.services.MhsConsole_ssug8i_MhsConsoleImpl_1032_WLStub.queryByRange(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
         ... 66 more

    what happens if you do the following on all three different environments:
    SQL> select to_char(exp_date, 'dd-mon-yyyy hh24:mi:ss') from your_table where your_condition ;
    [pre]

  • Query a column of data through IFS?

    We need to know how to query a column of data through iFS (if this is even possible). For instance, in our database, there is a table ODM_TEST with a column RELEVANT_LOCATION. To get the unique values, we'd just query in SQL:
    SELECT DISTINCT(relevant_location) FROM odm_test
    WHERE relevant_location is not null
    ORDER BY relevant_location
    Is there a way of doing that through the iFS API?
    null

    You can use Selector or Search API of iFS to do the query. Selector is used for simple queries and Search is used for complex queries.
    For example, page 8-9 of Developer Reference of iFS release 9.0.1 has an example of how to use a selector to do the following query -
    SELECT * FROM ATTRIBUTE WHERE DATATYPE = BOOLEAN ORDER BY NAME DESC, REQUIRED
    You can also fine examples of how to use Search classes in the same chapter.
    I hope it helps.
    null

  • Query execution failed for data set

    Hi,
    We are using SQL 2005 server for generating reports.When we ran the reports it taking so much time after some time it shows this error:---
     ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set  ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command.  The results, if any, should be discarded.
    Can you help me out.
    Thanks,
       --Amit

    My team is also facing similar problem. The RS trace logs report:
    w3wp!processing!13!9/26/2007-15:31:23:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'msdb'., ;
     Info: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'msdb'. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command.  The results, if any, should be discarded.
    Operation cancelled by user.
    In our system, Report Server and Database are on different machines. Report Server access database using a service account who has stored proc execute permissions on database.
    Problem comes only if the query execution time exceeds 5 mins. Otherwise the report gets generated successfully.
    I suspected this to be some timeout issue. But I have checked that all timeout settings in rs config files are as default.
    Any pointers?
    Thanks
    puns
    [email protected]

  • SQL Query for SSRS has data but fields don't show that data

    I am having a strange issue here with my new report;
    First off, this report is an availability report for employees. If they are busy then a 0 should be displayed for that Hour and if they are free then a 1 is to be displayed. There are 2 parameters setup for use in this query, one is a Date/Time parameter
    and the other is a Text parameter where another Dataset Query is grabbing the data for (Departments)
    I have 2 Parameters, 1 is for a Department and the other is to select the date.
                           Hour1     Hour2    Hour3     Hour4    Hour5   
    Hour6    Hour7
    Smith, John     |     1     |     0     |     0     |     0     |   
    1     |     1     |     1     |
    Som, One        |     1     |     1     |     1     |     0
        |    0     |     1     |     1     |
    When I run the query in the Query Designer for the Dataset the information is displayed correctly and as I would expect it, however, when I run the Report and choose the same information for the 2 parameters then the report only ever shows all 1's;
    Smith, John     |     1     |     1     |     1     |     1     |   
    1     |     1     |     1     |
    Som, One        |     1     |     1     |     1     |     1    
    |    1     |     1     |     1     |
    I've tried searching but didn't know what term to use that describes what is going on.
    Like I said, this works if ran in SSMS and works when ran in the Query Builder of SSRS but when it comes to displaying the data on the report the incorrect information is displayed.
    Any help would be appreciated.
    EDIT
    I have also ran the Report Table Wizard with the same query and chosen Names as the row and Hours as the columns and the same thing happens - just all 1's are displayed even thought the query in Query Builder shows correct information.

    The difference running the query directly in query designer and when the report runs is that you manually type in values for the parameters when running query designer. It is likely that the parameter values from the report have a different syntax than you
    expect. This will happen especially when setting the available values of a parameter from a data cube query. A value from an analysis cube may be displayed in the query designer as "\Project\Iteration Node" while the actual value is "[Work Item].[Iteration
    Hierarchy].[Iteration2].&[-7189901615194941888]&[-8272609059741292246]". Very different as you can see. This example is from the TFS analysis server.
    The best way to validate that your parameters are passing the values (and syntax) you expect is to add text boxes to your report for each parameter and set them to display Parameters!ParameterName.Value.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Adhoc Query Requirement with Multiple Data Source

    Hi All,
    I have a Adhoc Query Requirement with Multiple Data Source. Is there any way to achive it. Other than Resultant set and bring into Model.
    Thanks
    SS

    You can compare stuff in the EL, but I don't think this is what you need.
    You can just use Java code in the backing bean class for all the business logic. You can use DAO classes for database access logic. Finally for displaying you can use the JSF tags such as h:outputText.

Maybe you are looking for

  • Itunes wont open runtime error :\

    Everytime I try to open iTunes I get this even after reinstalling and repairing it: Application popup: iTunes.exe - Application Error : The instruction at "0x10001040" referenced memory at "0x10001040". The memory could not be "read". Click on OK to

  • Open file vi return not a refnum in executable

    Hey there, I have a the "Open/Create/Replace File" vi in an executable. It works perfectly fine on my development machine, both in development and in the executable. When I install it on another machine, the <not a refnum>-function returns true. It s

  • To get details after second list in interactive report

    hai abap experts, i got a problem, i have written acode in which 3rd list is not executing how to write code for 3rd list(my 3rd list is to get item details by call transaction 'me23') i'll send u all my  code lz check n help out. TABLES : EKKO,     

  • Please Dont say "Yes" ...Updating Itunes

    Hello Everyone, Please please please dont say YES ... i tried to update itunes to the latestest version last Saturday, it downloaded to the prompt screen where is says "RUN" software, UNFORTUNATELY my 16 year old wanted to use MSN and crashed the PC

  • Two problems with recent kernels - KMS resolution and fan speed

    Two issues have arisen since kernel26-2.6.32-6.  One is that that the boot process and all consoles only use approx. two-thirds of the screen, with the correct console font - as if the resolution is being detected as 800x600 rather than 1440x900.  Th