Incomplete query, filtering with a null field

Hi Experts,
Very new in the forum and SAPB1 in general and very week in SQL queries. I have the below query
SELECT T0.[ItemCode], T1.[ItemName],T0.[U_PKGS],T0.[U_InvNo],  T0.[U_File_Number],T0.[LotNumber] AS Garden,T0.[U_Sale_Number],T0.[CreateDate],T0.[U_GROSSWT], T0.[U_Net_Weight], T0.[U_TareWT]  FROM OBTN T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode where LEFT(T0.Itemcode,2)='T1' and T0.[LotNumber]=[%0]
and I need all records where the field U_Sale_Number is null to be part of the query, I have tried the empty space("") but its not working.
I also want an int variable declared to cater for number of days between the T0.[CreateDate] field and the current date or system date, I know you can use a DATEDIFF function to get the number of days between the 2 dates but I don't know how to go about it. Kindly assist.
Patrick.

Hi Patrick........
Welcome to SAP Forum......
SELECT T0.ItemCode, T1.ItemName,T0.U_PKGS,T0.U_InvNo, T0.U_File_Number,T0.LotNumber AS Garden,T0.U_Sale_Number,T0.CreateDate,T0.U_GROSSWT, T0.U_Net_Weight, T0.U_TareWT FROM OBTN T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode where LEFT(T0.Itemcode,2)='T1' and T0.LotNumber='[%0]' And T0.U_Sale_Number Is Null
Regards,
Rahul

Similar Messages

  • Query filters with double quotes fail

    Hi,
    when I to execute a query with a filter that contains double quotes on
    Kodo 3.0.3 I get an Exception.
    Filter:
    string == \"My name is \"Wolfgang\".\"
    Kodo interprets the double quotes (after 'is ' )as the end of the string
    and expects the next token ('Wolfgang') to be an attribute name.
    Is there an escape character for double quotes or any other solution?
    Exception:
    kodo.util.UserException: Attempt to query nonexistant or unm
    anaged field "Wolfgang" of type "de.logas.datenbank.jdo.BeispielKlasse1".
    at kodo.query.FilterParser.traversePath(FilterParser.java:1061)
    at kodo.query.FilterParser.eval(FilterParser.java:783)
    at kodo.query.FilterParser.getValue(FilterParser.java:999)
    at kodo.query.FilterParser.eval(FilterParser.java:813)
    at kodo.query.FilterParser.getExpression(FilterParser.java:1021)
    at kodo.query.FilterParser.parseFilter(FilterParser.java:204)
    at
    kodo.query.JDOQLQuery$DataStoreQueryExecutor.<init>(JDOQLQuery.java:4
    27)
    at
    kodo.query.JDOQLQuery.newDataStoreQueryExecutor(JDOQLQuery.java:99)
    at kodo.query.AbstractQuery.internalCompile(AbstractQuery.java:576)
    at kodo.query.AbstractQuery.compile(AbstractQuery.java:531)
    at kodo.datacache.CacheAwareQuery.compile(CacheAwareQuery.java:271)
    -- Wolfgang

    Also, in general, it is advantageous to separate variable content in a
    query out into parameters. This helps us out when maintaining our query
    compilation cache.
    -Patrick
    Stephen Kim wrote:
    Wolfgang,
    To do this in JDO you have to double escape it
    i.e. string== \"My name is \\\"Wolfgang\\\".\"
    Wolfgang Hutya wrote:
    Hi,
    when I to execute a query with a filter that contains double quotes on
    Kodo 3.0.3 I get an Exception.
    Filter:
    string == \"My name is \"Wolfgang\".\"
    Kodo interprets the double quotes (after 'is ' )as the end of the string
    and expects the next token ('Wolfgang') to be an attribute name.
    Is there an escape character for double quotes or any other solution?
    Exception:
    kodo.util.UserException: Attempt to query nonexistant or unm
    anaged field "Wolfgang" of type "de.logas.datenbank.jdo.BeispielKlasse1".
    at kodo.query.FilterParser.traversePath(FilterParser.java:1061)
    at kodo.query.FilterParser.eval(FilterParser.java:783)
    at kodo.query.FilterParser.getValue(FilterParser.java:999)
    at kodo.query.FilterParser.eval(FilterParser.java:813)
    at kodo.query.FilterParser.getExpression(FilterParser.java:1021)
    at kodo.query.FilterParser.parseFilter(FilterParser.java:204)
    at
    kodo.query.JDOQLQuery$DataStoreQueryExecutor.<init>(JDOQLQuery.java:4
    27)
    at
    kodo.query.JDOQLQuery.newDataStoreQueryExecutor(JDOQLQuery.java:99)
    at
    kodo.query.AbstractQuery.internalCompile(AbstractQuery.java:576)
    at kodo.query.AbstractQuery.compile(AbstractQuery.java:531)
    at
    kodo.datacache.CacheAwareQuery.compile(CacheAwareQuery.java:271)
    -- Wolfgang

  • 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 problem with multiple date fields.

    I need to select the greatest date from six different fields in each record and identify from which column was selected.
    date01 date02 date03 date04 date05 date06
    010190 010107 010190 010190 010190 010190
    010190 010190 010105 010190 010190 010190
    010103 010190 010190 010190 010190 010190
    1)if greatest is in date01 then S = 1
    2)if greatest is in date02 then S = 2
    3)if greatest is in date03 then S = 3
    4)if greatest is in date04 then S = 4
    5)if greatest is in date05 then S = 5
    6)if greatest is in date06 then S = 5
    Do you have any idea on how to acomplish this?
    Thanks

    Another way (won't work for null dates):
    with
    the_data as
    (select to_date('01011990','DDMMYYYY') col1,to_date('01012007','DDMMYYYY') col2,to_date('01011990','DDMMYYYY') col3,
            to_date('01011990','DDMMYYYY') col4,to_date('01011990','DDMMYYYY') col5,to_date('01011990','DDMMYYYY') col6
        from dual union all
    select to_date('01011990','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012005','DDMMYYYY'),
            to_date('01011990','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012005','DDMMYYYY')
        from dual union all
    select to_date('01012003','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012003','DDMMYYYY'),
            to_date('01011990','DDMMYYYY'),to_date('01012003','DDMMYYYY'),to_date('01011990','DDMMYYYY')
        from dual
    the_setup as
    (select rownum the_row,col1,col2,col3,col4,col5,col6,greatest(col1,col2,col3,col4,col5,col6) the_greatest,
            to_char(col1,'DDMMYYYY') || to_char(col2,'DDMMYYYY') || to_char(col3,'DDMMYYYY') ||
            to_char(col4,'DDMMYYYY') || to_char(col5,'DDMMYYYY') || to_char(col6,'DDMMYYYY') dates
       from the_data
    the_columns as
    (select the_row,
            max(decode(position,1,'1,')) || max(decode(position,2,'2,')) || max(decode(position,3,'3,')) ||
            max(decode(position,4,'4,')) || max(decode(position,5,'5,')) || max(decode(position,6,'6,')) the_cols
       from (select distinct the_row,level position
               from the_setup
              where substr(dates,8 * (level - 1) + 1,8) = the_greatest
             connect by level <= 6
    group by the_row
    select col1,col2,col3,col4,col5,col6,the_greatest,rtrim(the_cols,',') the_columns
      from the_setup s,the_columns c
    where s.the_row = c.the_row
    order by s.the_row
    ==========================================================================================================
    COL1       | COL2       | COL3       | COL4       | COL5       | COL6       | THE_GREATEST | THE_COLUMNS
    ==========================================================================================================
    01.01.1990 | 01.01.2007 | 01.01.1990 | 01.01.1990 | 01.01.1990 | 01.01.1990 | 01.01.2007   | 2
    01.01.1990 | 01.01.1990 | 01.01.2005 | 01.01.1990 | 01.01.1990 | 01.01.2005 | 01.01.2005   | 3,6
    01.01.2003 | 01.01.1990 | 01.01.2003 | 01.01.1990 | 01.01.2003 | 01.01.1990 | 01.01.2003   | 1,3,5Regards
    Etbin

  • ADF query panel with table, adding new search fields dynamically

    I am a beginner very new to ADF world. I have a ADF query panel with table which has its source from a ViewCriteria. I need to add a new search field on the form dynamically based on the user's need. Assume I am using a Employee table and I have search "employee ID" as one field in the form, upon clicking a add button in the form I need to have a another "employee ID" field appears along with the already existing one.
    I tried to add the condition in ViewCriteria but do not know how to add it ?
    Could some one pls address how it can be approached ?

    User, please always tell us your jdev version.
    Well, this use case need some thinking to be done. What do you want to archive with adding a new query field to the panel? As you said you already have one field for employeeId and now, on a click on a button, you add another one. How would the resulting query work with the new field? Should it use 'and' to concatenate the query or should it use 'or'?
    I suggest that you use the ADF Riche Client Demo (http://jdevadf.oracle.com/adf-richclient-demo/faces/index.jspx) select the Query node and then select 'af:query'. This shows you what is possible otu of hte box using the af:query component. You can add fields to existing queries in advanced mode (e.g. use system query 5, which starts with an empty panel and allows you to add fields).
    Once you understand how this works you may come back with a more detailed use case description or you have found the solution already. Read the documentation on af:query along with trying otu the component.
    Timo

  • Problem with a Currency field in Adhoc Query - HR

    Hi,
    I have an Adhoc query that uses Custom infotype fields (Z infotype and z fields).
    The currncy field also has a reference field in the infotype (of type waers).
    Wehen we try to get the ouput of the Adhoc Query it gives following error:
    The report cannot be generated because the internal description is invalid or incomplete, or because the selection screen is too large.
    Regenerate the assigned InfoSet, and read the log. If the InfoSet is OK, make sure that at least one field is given as output.
    If you used the 'Refresh' icon to start the query, use the 'Output' menu option to execute the query. This gives you a full screen display of the data.
    If an output was generated, the query cannot work with actual data in the construction view. In this case, always use the 'Output' function to execute the query.
    I have already tried a number of solutions:
    1> Regenerate the infoset...
    2> make the field as an additional field and write my own code for it (the error comes before the code as i kept a breakpoint but it stopped before that)
    if i add other fields of this infoset instead of this field, then those appear in the output.
    Any solutions ??
    thanks in advance,
    Anuj

    Hi,
    Is the problem not clear or no one has an answer?
    Please reply with some suggestions..
    Regards,
    Anuj.

  • WIS 00015 error- Multiple Query Filters contain a prompt with same name

    Hi
            I am working BOXIR2 environment. I created two prompts at Universe level- one of Date field and one on agency name field.
    syntax for the prompts is
    customerInfo.RSRCE_NAME =  @Prompt('Enter value(s) for AgencyName ','A' , , ,)
    datetable.STARDATE =datetable.STARDATE.STARTDATE =  @Prompt(' 'Enter value(s) for StartDate:','D' , , ,)
    When I include even one of  the prompts in the report I am getting an error WIS 00015 Multiple Query Filters contain a prompt with the same text, but the prompts use a different operand type.
    If I try to change text of one of the prompts in Universe selection statement, then I see the prompt two times in the report.
    Please let me know how to overcome this issue.

    Ok, I've simplified the case.
    Here is the real case :
    Object filter =
    Based on object =
    .[LEVEL01]
    Object filter =
    Based on object =
    .[LEVEL01]
    In WBI query result I take these objects :
    .[LEVEL01]
    .[LEVEL01]
    .[4IUX93YJGXQEHGLX0T0GPNA9Y]
    In query filters, my 2 filters with same text :
    1.
    I run the query.
    Answer to question 'Single Year Period ?' = Period 06 2010
    ==> MDX error
    A database error occured. The database error text is: Echec de l'exécution de la requête MDX SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006] avec l'erreur Invalid MDX command with . (WIS 10901)
    And you can see that the value sent to both filters is the same and come from the first filter .[Z12010006] instead of applying the value to each filter .[Z12010006] for the first one and .[Z12010006] for the second one.
    Please, notice that if I change the order of this 2 filters in the WBI query, the MDX generated become :
    SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006]
    Thanks for your help.
    G.OM.

  • Dynamic filtering with BEx query variables in WebI 3.1

    Hi experts.
    Can anybody help me ?
    1) I use BEx query variables in WebI 3.1 .  But i can't understand how to order fields of selection screen in WebI reports
    2) How can i use Dynamic filtering with BEx query variables in WebI 3.1 ?
        It's need that  list of second field on selection screen will be accoding to result of selection first field on selection screen and so on .
        Need i use BEx user-exit variables ?
    Thank you

    Hi,
    1)  Variable sequence isn't respected in XI3.1 - and can't be modified in OLAP.unv  (this enhancement exists in 4.0 )
    2)  Dynamic filtering?  Yes, Exit routines are the best way to go for this.
    Regards,
    H

  • Failing to refresh LOV fields added in the query panel with table

    Hi.. Iam using Jdev 11.1.1.2.0
    I have a scenario like ..i need to add 2 cascaded lovs in search panel and clicking on search button, the result should be displayed in table form.
    For example..
    I have cascaded LOV fields departmentId and Firstname ,
    first name dropdown values depends on the selection of value in DepartmentIddropdown. I need to add only these 2 fields in search panel and clciking on search buton , the result should be displayed in emp table.
    I have achieved the same creating View criteria with 2 fields and dragging and dropping that as query panel with table. But my problem is First name lov is not populating based on department id. It is showing static dropdown list.
    Please help me how to achieve this ? thanks in advance.
    Regards
    Alekhya.

    Thanks for the reply.. actually if iam using those cascaded lovs in a form then we can set properties as u mentioned to refresh and display values correctly in the dropdown.
    My scenario is like i need to use those fields in query panel header
    code snippet
    <af:panelHeader text="Employees" id="ph1">
    <af:query id="qryId1" headerText="Search" disclosed="true"
    value="#{bindings.EmployeesViewCriteria1Query1.queryDescriptor}"
    model="#{bindings.EmployeesViewCriteria1Query1.queryModel}"
    queryListener="#{bindings.EmployeesViewCriteria1Query1.processQuery}"
    queryOperationListener="#{bindings.EmployeesViewCriteria1Query1.processQueryOperation}"
    resultComponentId="::resId1"/>
    </af:panelHeader>
    Iam not having any field names to add properties.
    Regards
    Alekhya

  • ADF Query Panel with Tree Table -- Add Fields

    I created ADF Query Panel with Tree Table using JDeveloper 11G. Under Advance Search, Add Fields pull down only list the fields in the master table. My questions are,
    1) Can I search fields in detail table? If yes, how can I do it?
    2) How can I customized this pull down list? Currently it just show the entire view of master table with unnecessary id type data.
    Thanks in advance.
    Edited by: kxc on Nov 9, 2009 9:21 AM

    1) Can I search fields in detail table? If yes, how can I do it?
    Are there anyway to search the second level node?You can. But you need to evaluate if the arrangement works for you.
    I assume you have a view link from the master to detail VO.
    To do so, in your master view criteria (the one which you use in the query panel), shuttle the attributes of your detail VO (in master attributes list, you'l see the detail view link accessor - on selecting this, the detail atteributes are available to you)
    In the Add Fields, it shows as student_id AND student_name. I was unable to delete the student_id field in the view since it is PKYou can set its 'display' UI hint to 'hide' in your VO.

  • Jms message filtering with multiple fields

    Hi
    Can anybody please tell me how to do message filtering with multiple fields. i using jdeveloper11.1.1.4.0 , soa11g suite and weblogic 10.3.
    previously i used JMSType property for one field filtering.
    and is it possible to invoke jms adapter with our own properties (adding property to jms).
    thanks,
    Sourbh

    thanks atheek
    i worked with the same and it helped me a lot i can share one more link that will help.
    http://forums.oracle.com/forums/thread.jspa?messageID=9650255&#9650255
    Regards,
    Sourbh.

  • Weird errors with a DATE field in a certain row

    We have a table with an exp_date field of DATE datatype. One row is giving us mysterious problems.
    If I query the row in sqlplus, the exp_date field displays 18-Jun-04. The same query in Oracle SQL Developer displays 19-Jun-04. The same query in TOAD returns a NULL field, and adding "exp_date IS NULL" to the query returns no rows (since it really isn't NULL!).
    In sqlplus, if I use trunc() or round() on exp_date, it gets bumped up to 19-Jun-04.
    This field for this record is causing some issues in our java classes as well, we're adding some more logging/exception handling to find out exactly what they are.
    Any thoughts?
    FWIW this is on Oracle 10gR2 (10.2.0.2).
    Message was edited by:
    dtseiler

    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]

  • Problem with modifying table field with SQL

    In a particular table, there are some values that end with a null character (ascii(0)) and we don't want them null-terminated. I've been trying to use the following SQL statement to find those fields and then remove the null character from the end (each record has a 'field_id' field and the 'value' field which holds the actual value of that field_id):
    update num_data
    set value = substr(value,1,instr(value,ascii(0))-1)
    where field_id = 'FIELD1'
    select field_id
    from num_data
    where ascii(substr(value,length(value),1)) = 0
    All it does is execute for several minutes before I just have to interrupt it, and no changes are made.

    I see I messed up; the query should have been:
    update num_data
    set value = substr(value,1,instr(value,ascii(0))-1)
    where field_id in
    select field_id
    from num_data
    where ascii(substr(value,length(value),1)) = 0
    But since I wrote this note, I ran that query again, and it worked as I wanted it to; maybe our DB was running slow at that time, though I waited a few minutes for results.
    I appreciate you two taking the time to respond.

  • Union reporting involving null fields.

    Hello ALL;
    I'm new to OBIEE and the following is a query on 10g.
    I use the union reporting using dummy/null fields as the Subject areas are built in a way that they don't include all fields one report would need at my work place.
    (Let me know if I could work otherwise)
    Suppose I have a, b fields from S1 and c from S2, I implement the following approach:
    S1 a b 0
    S2 a 0 c
    What I expect to see is:
    Result a b c
    What I see is:
    Result a b 0
    a 0 c
    I see two records with one ID(feild a).
    Could anyone help me on this, please?
    Thanks,
    -RB

    Goto Table View in the answers, change result column formula to avg(saw_1 by saw_0).

  • Date object doesn't work in query filters

    I'm trying to create a universe object called Next Biweekly Pay End Date.  Some background: there is an end date for our biweekly payrolls every 14 days, and the logic behind the object is basically that if there was a biweekly pay end date 7 days ago, the next one is 7 days from today (that is, sysdate + 7), etc.</p>
    I have it working so that it displays the correct date when used in a WebI report.  However, when I use it in a query filter in a WebI report (like, Pay End Date = Next Biweekly Pay End Date), I don't get an error, but I also don't get any data.  Somehow my object doesn't work in a query filter.  The purpose of the object is for use in query filters, so I need to get this to work.</p>
    My best guess about why it doesn't work in a query filter is due to some issue with the data type.  Pay End Date has a data type of date in the universe.  I gave Next Biweekly Pay End Date a data type of date also, but the query filter still doesn't work; I get "no data to fetch."</p>
    We're using XI 3.1.6 and Oracle 10.  Any ideas about how to get this to work?</p>
    If it helps, here is the definition of Next Biweekly Pay End Date.  The logic is that it takes today's date, subtracts Oct. 31, 2009 (a biweekly pay end date), divides by 14, and looks at the remainder.  If the remainder is 0, then today is a pay end date and the next one is 14 days from now.  If the remainder is 1, yesterday was a pay end date and the next one is 13 days from now, etc.</p>
    case</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 0 then (sysdate + 14)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 1 then (sysdate + 13)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 2 then (sysdate + 12)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 3 then (sysdate + 11)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 4 then (sysdate + 10)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 5 then (sysdate + 9)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 6 then (sysdate + 8)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 7 then (sysdate + 7)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 8 then (sysdate + 6)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 9 then (sysdate + 5)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 10 then (sysdate + 4)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 11 then (sysdate + 3)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 12 then (sysdate + 2)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 13 then (sysdate + 1)</p>
    end

    Thanks for the suggestions.
    I did some more testing, and there seems to be something more complicated going on.  I ran the following code in SQL*Plus:
    SELECT distinct M_PYDW1.PYSTATUS.DW_OWNER,
    case
    when to_date(sysdate, 'dd/mm/yyyy hh24:mi:ss') >= to_date('01/01/2010','dd/mm/yyyy hh24:mi:ss') then To_Date((sysdate - 2),'dd/mm/yyyy')
    else to_date(sysdate +2, 'dd/mm/yyyy')
    end
    FROM M_PYDW1.PYSTATUS
    The condition should be true, because the sysdate (today is Jan. 20) is greater than 1/1/2010, so I should get a result of sysdate - 2 (Jan. 18).  But the result I get is Jan. 22 (sysdate +2).  It seems that the comparison is failing even though I'm formatting both sysdate and 1/1/2010 as dates with a timestamp.  What could cause that?
    One more mystery: when I run the same code as above in a WebI report (using custom SQL), I get the error ORA-1830, date format picture ends before converting entire input string.

Maybe you are looking for