Passing a List  in RQL Query

Hi,
Can any one guide me how to pass a list in a RQL Query. If not possible Can you suggest me some other ways to do it.
Need to write a string query similar to the below mentioned
select COST, SUM(_CNT)from cost_details where aaa IN(?) group by COST;
Thanks,
Santhosh.
Edited by: 957040 on Sep 11, 2012 11:53 PM

You can probably use INCLUDES, INCLUDES ANY or INCLUDES ALL type of query. These can be used for multi value properties which are scalar like string, boolean etc. i.e. properties declared with component-data-type in repository definition.
http://docs.oracle.com/cd/E35318_01/Platform.10-1-1/ATGRepositoryGuide/html/s0305multivaluedpropertyqueries01.html
There is also one INCLUDES ITEM type of query which can be used for properties that point to multiple items of another or same item descriptor. I have not tried it so not sure but I think those item descriptor should be within same repository.

Similar Messages

  • How to pass a list of parameters to a query?

    Hi,
    I use OracleXE 10 Database with JDeveloper 11g.
    In my project I use a Toplink mapping to get access to the database (Toplink Object Map file). This mapping xml file is called crmMap.xml.
    In the crmMap.xml file I define a mapping to a "User table" which has the four columns id (number), title (varchar2), firstName (varchar2) and lastName (varchar2). A title can have the four values Bachelor, Master, Doctor and Professor.
    I do define a query in crmMap.xml which has to find all the users that have a special title. I do give the query one parameter called "title" which has the type "java.util.ArrayList". The parameter "title" is a list that has for example the two values "Bachelor" and "Doctor", if I want to find all the users that are Bachelor or Doctor. The query looks like this ...
    Select * from User where title in(?title)I do use an EJB Session Bean to call the query. The code looks like this ...
    public List<User> findUserByStatus() {
        Session session = getSessionFactory().acquireSession();
        Vector params = new Vector(1);
        List stati = new ArrayList();
        stati.add("Doctor");
        stati.add("Bachelor");
        params.add(stati);
        List<User> result = (List<User>)session.executeQuery("findUserByStatus", User.class, params);
        session.release();
        return result;
    }Doing this I get an error, in the line
    List<User> result = (List<User>)session.executeQuery("findUserByStatus", User.class, params);while the app is trying to execute the query.
    Part of my log
    WARNING: ADFc: Invalid column type
    java.sql.SQLException: Invalid column type
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:116)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:177)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:233)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:407)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7931)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7511)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8168)
         at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8149)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:229)
         at oracle.toplink.internal.databaseaccess.DatabasePlatform.setPrimitiveParameterValue(DatabasePlatform.java:1694)
         at oracle.toplink.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:1684)
         at oracle.toplink.platform.database.oracle.Oracle9Platform.setParameterValueInDatabaseCall(Oracle9Platform.java:339)
         at oracle.toplink.internal.databaseaccess.DatabasePlatform.setParameterValuesInDatabaseCall(DatabasePlatform.java:1669)
         at oracle.toplink.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:649)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:517)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
         at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:674)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
         at oracle.toplink.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2260)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1074)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:945)
         at de.virtual7.crmTL.model.crmFacadeBean.findUserByStatus(crmFacadeBean.java:720)
         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:281)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:15)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:30)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         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:176)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
         at $Proxy90.findUserByStatus(Unknown Source)
         at de.virtual7.crmTL.model.crmFacade_etlagg_crmFacadeLocalImpl.findUserByStatus(crmFacade_etlagg_crmFacadeLocalImpl.java:838)
         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.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:563)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2119)
         at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:2929)
         at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:396)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:258)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1441)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2126)
         at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:414)
         at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:311)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:697)
         at oracle.adf.model.binding.DCInvokeAction.refreshInternal(DCInvokeAction.java:46)
         at oracle.adf.model.binding.DCInvokeAction.refresh(DCInvokeAction.java:32)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:2970)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2639)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(PageLifecycleImpl.java:110)
         at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareModel(FacesPageLifecycle.java:77)
         at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(Lifecycle.java:135)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:190)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.mav$executePhase(ADFPhaseListener.java:19)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:229)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:265)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:69)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:51)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:354)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         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:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:85)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:257)
         at oracle.security.jps.wls.JpsWlsSubjectResolver.runJaasMode(JpsWlsSubjectResolver.java:250)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:100)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    07.09.2009 11:50:16 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNUNG: ADFc: EJB Exception: : Lokaler Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g (11.1.1.0.1) (Build 081030)): oracle.toplink.exceptions.DatabaseException
    Interne Exception: java.sql.SQLException: Ungültiger Spaltentyp
    Fehlercode:17004
    Aufruf:Select * from User where title in(?title)
         bind => [[Doctor,Bachelor]]Does anyone know a way how to pass a list of parameters
    Thanks Bodhy

    Hi,
    One alternative way is to create String with , sepearted as pass the string to in clause.For example ,create a string ('Bachelor','Doctor') and pass this string to in clause.
    Session session = getSessionFactory().acquireSession();
    String params=( 'Bachelor','Doctor);
    List<User> result = (List<User>)session.executeQuery("findUserByStatus", User.class, params);
    session.release();
    This is an alternative way and workaround which can work for Strings .
    Or you can use EXpression to build the query to pass the collection as example given below.
    Expression addressExpression;
    ReadObjectQuery query = new ReadObjectQuery(Employee.class);
    ExpressionBuilder emp = query.getExpressionBuilder();
    addressExpression =
    emp.get("address").get("city").equal(
    emp.getParameter("employee").get("address").get("city"));
    query.setName("findByCity");
    query.setSelectionCriteria(addressExpression);
    query.addArgument("employee");
    Vector v = new Vector();
    v.addElement(employee);
    Employee e = (Employee) session.executeQuery(query, v);
    Hope this helps.
    Regards,
    Vinay Kumar

  • Dynamically passing the values to IN query in JDBC

    Hi,
    I have a list which contains a single or multiple values which does have CustomerVO as a generic.Here i need to iterate the list pass these values to "IN" query.
    These should happen dynamically, as we dont know whether the list will hold a single or multiple value. If the list.size ==1 , then it contains a single value in it. Hence there is no need for a comma(,) in the IN query else we need to have it, like .... IN (Aaron,Bob). Please help me in this?
    Thanks.

    797836 wrote:
    I have a list which contains a single or multiple values which does have CustomerVO as a generic.Here i need to iterate the list pass these values to "IN" query.
    These should happen dynamically, as we dont know whether the list will hold a single or multiple value. If the list.size ==1 , then it contains a single value in it. Hence there is no need for a comma(,) in the IN query else we need to have it, like .... IN (Aaron,Bob).So basically you need to output the List (capital 'L') as a comma-delimited list (small 'l').
    The procedure for that is usually something like:
    1. Output the first element.
    2. For any further elements:
    2a. Output ","
    2b. Output the element.
    Winston

  • ORA-01722: invalid number performing List of Values query

    I have a situation here where I want to pass string value(available in search field) to POP up key LOV on another page as default value.
    I passed item value in default field in POPup key LOV item.I am able to see string value but It also gave me following error.
    Error: ORA-01722: invalid number performing List of Values query: "select CUSTOMER_NAME, CUSTOMER_ID from (select customer_name, customer_id from hed_customers) wwvlovinlineviewname where CUSTOMER_ID = :WWV_LOV_RETURN_KEY_UTIL_1111".
    Without Default value, it work like champ.
    Please suggest how to get rid of this error
    Thanks in advance

    I hit the same problem.
    The thing is that, in APEX, a 'null' value in a form is not really null but gets passed on as '%'.
    When that gets compared to a number, 01722 will occur.
    A workaround is to define a 'value if null' that is an implicit number, like '-1'.
    And lets hope no one ever uses that as a real ID...
    Cheers
    Peter

  • How to pass a list as bind variable?

    How can I pass a list as bind variable in Oracle?
    The following query work well in SQL Developer if I set ":prmRegionID=2".
    SELECT COUNTRY_ID,
    COUNTRY_NAME
    FROM HR.COUNTRIES
    WHERE REGION_ID IN (:prmRegionID);
    The problem is that I can't find how to set ":prmRegionID=2,3".
    I know that I can replace ":prmRegionID" by a substitution variable "&prmRegionID". The above query work well with"&prmRegionID=2" and with "&prmRegionID=2,3".
    But with this solution, I lost all advantage of using binds variables (hard parse vs soft parse, SQL injection possibility, etc.).
    Can some one tell me what is the approach suggest by Oracle on that subject? My developer have work a long time too find how but didn't found any answer yet.
    Thank you in advance,
    MB

    Blais wrote:
    The problem is that I can't find how to set ":prmRegionID=2,3".Wrong problem. Setting the string bind variable to that means creating a single string that contains the text "+2,3+". THE STRING DOES NOT CONTAIN TWO VALUES.
    So the actual problem is that you are using the WRONG data type - you want a data type that can have more than a single string (or numeric) value. Which means that using the string (varchar2) data type is the wrong type - as this only contains a single value.
    You need to understand the problem first. If you do not understand the problem, you will not realise or understand the solution too.
    What do you want to compare? What does the IN clause do? It deals with, and compares with, a set of values. So it needs a set data type for the bind variable. A set data type enables you to assign multiple values to the bind variable. And use this bind variable for set operations and comparisons in SQL.
    Simple example:
    SQL> --// create a set data type
    SQL> create or replace type TStringSet is table of varchar2(4000);
      2  /
    Type created.
    SQL>
    SQL>
    SQL> var c refcursor
    SQL>
    SQL> --// use set as bind variable
    SQL> declare
      2          names   TStringSet;
      3  begin
      4          --// assign values to set
      5          names := new TStringSet('BLAKE','SCOTT','SMITH','KING');
      6 
      7          --// use set as a bind variable for creating ref cursor
      8          open :c for
      9                  'select * from emp where ename in (select column_value from TABLE(:bindvar))'
    10          using names;
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7698 BLAKE      MANAGER         7839 1981/05/01 00:00:00       2850                    30
          7788 SCOTT      ANALYST         7566 1987/04/19 00:00:00       3000                    20
          7369 SMITH      CLERK           7902 1980/12/17 00:00:00        800                    20
          7839 KING       PRESIDENT            1981/11/17 00:00:00       5000                    10
    SQL>
    SQL> --// alternative set comparison
    SQL> declare
      2          names   TStringSet;
      3  begin
      4          --// assign values to set
      5          names := new TStringSet('BLAKE','SCOTT','SMITH','KING');
      6 
      7          --// use set as a bind variable for creating ref cursor
      8          open :c for
      9                  'select * from emp where TStringSet(ename) submultiset of (:bindvar)'
    10          using names;
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 1980/12/17 00:00:00        800                    20
          7698 BLAKE      MANAGER         7839 1981/05/01 00:00:00       2850                    30
          7788 SCOTT      ANALYST         7566 1987/04/19 00:00:00       3000                    20
          7839 KING       PRESIDENT            1981/11/17 00:00:00       5000                    10
    SQL>

  • Drop down like behavior list in a query

    I would like to have drop-down list behaviour in a query. I could do it using with a  UDF (U_TipoMat) with 2 valid values set in a user table.
    DECLARE @TM Float
    SET @TM=(SELECT T0.U_TipoMat FROM .[@PARAMETROS] TO WHERE T0.U_TipoMat = )
    here it lets me select one of the 2 values stored in these UDF but it does not pass the value to the query
    Any ideas?
    Edited by: Héctor Ramón Santos Anaya on Mar 13, 2008 1:36 AM

    Hector,
    Can I know what is the end result you are trying to achieve.
    What are you trying to do with the value in the variable @TM.  Where are you planning to use this query?
    Also [dbo\].[@PARAMETROS\] TO ...you have use TO instead of T0.
    DECLARE @TM Float
    SELECT @TM = T0.U_TipoMat FROM [dbo\].[@PARAMETROS\] TO WHERE T0.U_TipoMat = '[%1\]'

  • Join query in a dynamic list of values query

    I have a join query in a dynamic list of values query. The value does not return a text value, but rather the id value.
    Is it possible to use a join query in a dynamic list of values query?
    For example...in the below query, I expect to see ename in the drop down list, but I see class_emp_id.
    select b.ename d, a.class_emp_id r
    from class_emp a, emp b
    where a.class_cat_id = :CURR_CLASS_CAT_ID
    and a.emp_id = b.emp_id
    order by 1
    Thanks,
    Reid

    :CURR_CLASS_CAT_ID is a number datatype.
    I think the problem is with the ARF. Whenever I change the dynamic LOV query to exclude the :CURR_CLASS_CAT_ID (a passed in session variable), the drop down shows all the text names I am looking for; albeit, too many since I am excluding the :CURR_CLASS_CAT_ID.
    The page I am having the problem with is a popup that is called from a report link on another page. When I show the session variables on the popup page, it shows values for only 1 of the 3 session variables I am passing to this page.
    I am using the javascript:popUp2 syntax when I call the popup page from the report link.
    As I said previously, I am passing 3 parms and only the 1st parm is getting a value. Yes, there are values for all three parms in the record of the report.
    Is there a limit to the number of variables (itemNames) that can be passed to the popup using this method?

  • How To Pass a List/Map Through iBatis to the Database?

    Hi, good morning.
    I am currenly using JSF as the front end of a J2EE application. Data go through many business logic layers and reach the database through the iBatis.
    The iBatis is new to me. To pass a query "String" from the front end to the database and get a "Collection" back from the database through the iBatis has been tested successful.
    Now, I have great difficulty to pass a "List" or a "Map" through the iBatis to the database? Is it possible to be done?
    The reason is that a table with thousands of records and each record has many name/value pairs may be sent to update the database. And looping through the table to send "String"s may not be a solution.
    Thank you in advance.

    Please help.

  • Difficulty in using a variable to pass a list of names between 2 tables

    Hi All,
    I am trying to pass a list of names from one table as a variable to another table and trying to find the Highest level they exist at in the hierarchy. I am having some troubles with the variable and need some guidence and also if this should be a procedure or not.
    this is what i have now :
    Variable man_name Varchar;
    exec :man_name = (Select full_name from direct_manager_report)
    UPDATE direct_manager_report
    Set Manager_level_number =
    (Select 'Manager_Level_0' from manager_hierarchy where level_0_manager_name = man_name
    UNION
    Select 'Manager_Level_1' from manager_hierarchy where level_0_manager_name < > man_name AND level_1_manager_name = man_name
    UNION
    Select 'Manager_Level_2' from manager_hierarchy where level_1_manager_name < > man_name AND level_2_manager_name = man_name
    UNION
    Select 'Manager_Level_3' from manager_hierarchy where level_2_manager_name < > man_name AND level_3_manager_name = man_name
    Where full_name = man_name;
    Let me know what modifications have to be done for this the variable to get the name from table 1 and find the manager level from table 2 and populate it back in table 1.
    Any help is appreciated.
    Thanks

    Frank Kulash wrote:
    Hi,Thanks for your reply. I am sorry for not providing enough information.
    What's wrong with what you have now? I want to pass the manager name (about 2000) from direct_manager_report to the variable which i pass to manager_hierarchy table to find the highest level for each manager
    If it doesn't give the right results, then how is anyone except you to know what the right results are?
    Variable man_name Varchar;
    exec :man_name = (Select full_name from direct_manager_report)Does that really work for you?No thats why i said this is what i have and i am trying to see the best to past the list of manager names to get the level number.
    UPDATE direct_manager_report
    Set Manager_level_number =
    (Select 'Manager_Level_0' from manager_hierarchy where level_0_manager_name = man_name
    UNION
    Select 'Manager_Level_1' from manager_hierarchy where level_0_manager_name < > man_name AND level_1_manager_name = man_nameIt looks like something is missing on the line above. Did you mean "level_0_manager_name != man_name"?
    This site doesn't like to display the &lt;&gt; inequality operator. Always use the other (equivalent) inequality operator, !-, when posting here.
    UNION
    Select 'Manager_Level_2' from manager_hierarchy where level_1_manager_name < > man_name AND level_2_manager_name = man_name
    UNION
    Select 'Manager_Level_3' from manager_hierarchy where level_2_manager_name < > man_name AND level_3_manager_name = man_name
    Where full_name = man_name;Are you sure the UNION will never return more than 1 row?
    Let me know what modifications have to be done for this the variable to get the name from table 1 and find the manager level from table 2 and populate it back in table 1.Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data (in this case, the contents of table1 after everything is finished).
    See the forum FAQ {message:id=9360002}Sorry did not realize the missing !. Yes the union will always return one record for each manager name passed. I have tested the select part which hard coding the manager name and it does update the level number correctly. but i am struggling with passing a large list of values as a variable.
    This is the output i am looking for in the direct manager report table is :
    Manager Name | Manager Level Number
    ABC Manager Level 0
    XYZ Manager Level 1
    This is the structure of the manager hierarchy:
    Manager Level 0 Manager Level 1 Manager Level 2...Manager Level 14
    ABC ABC ABC ABC
    ABC XYZ XYZ XYZ
    Let me try the below but hopefully i am more clear on the requirement now.
    >
    You may want something like this
    MERGE INTO  direct_manager_report     dst
    USING   (
             SELECT    dmr.full_name
             ,           'Manager_Level_'
                    || MIN ( CASE  dmr.full_name
                                 WHEN  level_0_manager_name  THEN '0'
                                 WHEN  level_1_manager_name  THEN '1'
                                 WHEN  level_2_manager_name  THEN '2'
                                 WHEN  level_3_manager_name  THEN '3'
                               END
                     ) AS manager_level_number
             FROM      manager_hierarchy  dmr
             JOIN      manager_hierarchy      mh   ON   dmr.full_name IN ( level_0_manager_name
                                                                   , level_1_manager_name
                                                , level_2_manager_name
                                                , level_3_manager_name
             GROUP BY  dmr.full_name
         )                    src
    ON     ( dst.full_name  = src.full_name )
    WHEN MATCHED THEN UPDATE
    SET     dst.manager_level_number = src.manager_level_number
    Edited by: user599926 on Jun 4, 2013 9:41 PM

  • How to link 2 queries in 11g (passing the result of 1 query to another)?

    Hi,
    I am using 11g and I have 2 queries q1,q2. the first query returns a column I need to use in q2 to get my data.
    q1:
    select name, dept
    from x
    where dept = :p_y
    q2:
    select u, b
    from y
    where name = :*name* (from q1)
    when I tried to do that BIP created a bind parameter (name). when I ran get xml, no data came out of q2!
    my question is how can I pass a column from 1 query to another?
    I hope this is clear
    Thanks,
    Edited by: Odeh on Oct 9, 2010 9:18 PM

    Thanks for your reply. I am sorry if I wasn't clear, may be this will help
    I am converting oracle report 6i into BI publisher.
    in my report (invoice), I am going to pass only one parameter (*p_invoice_no*)
    Q1:
    select address_id, vendor_id, bill_date, x, y,z
    from t1
    where invoice_no = :p_invoice_no
    now I need to display the payer address info. the address come from 2 different tables based on address_id and vendor_id
    Q2:
    SELECT NAME,
    ADDRESS1,
    ADDRESS2,
    CITY,
    STATE,
    ZIP,
    FROM address_1
    WHERE address_id = decode(*:vendor_id*, '28',*:address_id*, NULL)
    union
    SELECT VENDOR name,
    VENDOR_ADDRESS1 address1,
    VENDOR_ADDRESS2 address2,
    CITY,
    STATE,
    ZIP ,
    FROM address_2
    WHERE vendor_id = :*vendor_id*
    and vendor_id <> '28'
    as you can see from Q2, the address depends on address_id, vendor_id from Q1. it will be so much easier
    if I could just do that instead of doing nested statements. you would think with 11g this should be
    easily achievable. am I wrong ?
    I hope this helps
    Thanks again,

  • Is there a way to create a "Horizontal Links List" from a query?

    Hi,
    Is there a way to create a "Horizontal Links List" from a query?
    I want to display file names that I have uploaded as links to a display page.
    I don't know how to create my own template yet as I've read... I saw Jes had posted this idea...
    Thanks, Bill

    Yes, that is great Chris!
    Thanks for the site....
    Once I dynamically create the HTML for the list how do I feed it into the page?
    as an item? Can I access an HTML region body dynamically?
    Thanks, Bill

  • Error: ORA-01722: invalid number performing List of Values query.

    when i created a cascading select list, For the first time it worked properly then little later
    it is giving this error.
    Error: ORA-01722: invalid number performing List of Values query: "select distinct cl_name d, cl_no r from Kclient where gr_no = :P1_GRNO order by 1
    could any one please solve the problem?
    2. when i run the application. in all the items edit button is automatically seen
    including in the login screen.
    could any one identify what is the error and give me a solution.

    Is this better?
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER <> -1 order by 1or
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER != '-1' order by 1Is ROW_ID a column in your table by the way? If not, you should use ROWID (without the underscore)

  • Hyperlink on field in Basic list of ABAP Query

    Dear All,
    Could somebody tell me, if its possible to have a hyperlink on a field in the Basic list of ABAP Query (SQ01,SQ02).
    Example :- There is a basic list which has the field MARA-MATNR displayed.There should be a hyperlink on this field, such that when the user clicks on it , the transaction MM03 is called.
    Thanking You.
    Ranu

    Hi,
    Loop at itab.
    write:/ itab-matnr hotspot,
              itab-maktx.
    hide: itab-matnr.
    endloop.
    data: c_field(16).
    at line-selection.
      get cursor field c_field.
      if c_field  = 'ITAB-MATNR'.
        check not itab-matnr is initial.
        set parameter id 'MAT' field itab-matnr.
        call transaction 'MM03' and skip first screen.
      endif.
    This is one example to call the transaction.
    If this helps you award points.
    Thanks,
    Deepak.

  • Retrieve all items in a list by caml query then write it to a word file page by page

    Dears,
    Greetings
    I have some code which will retrieve all items of a list with caml query.
    Now i want to generate a word file with all these retrieved data. I am using foreach here to get all the items in a SPListItemCollection. Now my question is how i can write all the retrieved items inside the word file?
    see the below code which is writing only the last row item of the SPListItemCollection inside word file. I want to write all the retrieved rows inside this word file.
    SPQuery qry = new SPQuery();
    qry.Query = "<Where><Eq><FieldRef Name='Department' /><Value Type='Text'>HR DEPARTMENT</Value></Eq></Where>";
    SPListItemCollection listItems = KPILIst.GetItems(qry);
    foreach (SPListItem item in listItems)
    lblBadgeNo.Text = item["Badge No"].ToString();
    lblName.Text = item["Name"].ToString();
    lblPosition.Text = item["Position"].ToString();
    lblDept.Text = item["Department"].ToString();
    lblHireDate.Text = item["Hire Date"].ToString();
    lblGrade.Text = item["Grade"].ToString();
    lblCurStatus.Text = item["Status"].ToString();
    string FinalOut = "";
    FinalOut = "<table cellpadding=0 cellspacing=0><tr><td style='height:30px;'></td></tr><tr><td style='height:22px;'></td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblBadgeNo.Text + "</td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblName.Text + "</td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblDept.Text + "</td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblHireDate.Text + "</td></tr>";
    FinalOut = FinalOut + "</table>";
    System.Text.StringBuilder strBody = new System.Text.StringBuilder("");
    strBody.Append("<html " + "xmlns:o='urn:schemas-microsoft-com:office:office' " + "xmlns:w='urn:schemas-microsoft-com:office:word'" + "xmlns='http://www.w3.org/TR/REC-html40'>" + "<head><title>EPCCO : HR Comapny Letter</title>");
    strBody.Append("<!--[if gte mso 9]>" + "<xml>" + "<w:WordDocument>" + "<w:View>Print</w:View>" + "<w:Zoom>90</w:Zoom>" + "<w:DoNotOptimizeForBrowser/>" + "</w:WordDocument>" + "</xml>" + "<![endif]-->");
    strBody.Append("<style>" + "<!-- /* Style Definitions */" + "@page Section1" + " {size:8.5in 11.0in; " + " margin:1.0in 1.25in 1.0in 1.25in ; " + " mso-header-margin:.5in; " + " mso-footer-margin:.5in; mso-paper-source:0;}" + " div.Section1" + " {page:Section1;}" + "-->" + "</style></head>");
    strBody.Append("<body dir=rtl lang=EN-US style='tab-interval:.15in'>" + "<div class=Section1>" + FinalOut.ToString() + "</div></body></html>");
    Response.AppendHeader("Content-Type", "application/msword");
    Response.AppendHeader("Content-disposition", "attachment; filename=Eval_" + lblBadgeNo.Text + ".doc");
    Response.Write(strBody);
    Regards
    Shaji
    I am new to SharePoint

    Hello,
    you can try with OpenXML SDK to create word file. I found one link for your reference:
    http://sharepointplace.blogspot.in/2009/12/programmatically-creating-word.html
    Another way is , use Microsoft Word Object Library.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/5b82c0b5-ecaf-40f2-a68a-c7c17c85414f/create-word-documents-by-c?forum=csharpgeneral
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How can i pass a parameter to the query to filter the result of this lookup

    Hello,
    i'm developping a web application with JDeveloper 10.1.2 and JHeadStart.
    i realy need to know how can i filter the lookup (LOV) query result.
    in other word, when i click on the lookup, it show all the row that exist in may data base table.
    what i want is how can i pass a parameter to the query to filter the result of this lookup ?
    Thank you

    Hi,
    have a look if this helps
    http://oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    Frank

Maybe you are looking for

  • Error while transporting into qty

    dear all, Am facing the followingproblem while importing Developed  objects into qty, am facing the folowing error, am impoting Infoarea,infoabject catalog infoobject collected in one request datasource,Ipac, transformation ,DTP and its aplication co

  • Error running a test application in jDeveloper

    I have developed an application and want to run a test. But when I click run- I get a message: Target ddjasd;asjd cannot be started as a Servlet ... Its not a servlet- What is causing jDeveloper to want to run as a servlet? thanks al

  • Resizing Problem PSE 11

    PSE 11 Mac OSX 10.8.5 I have been resizing some of my scanned images on my hard drive to reduce their size and free up hard disc space. The resizing process seems to be working normally - save.replace existing file etc. but strangely on RANDOM occasi

  • Event driven programmin​g examples

    I want to create one static event (Boolean value change type), which when occur should register one dynamic event(Boolean value change type) in it. Thus until static boolean value doesn't change, dynamic event cannot be registered.Can anyone give a e

  • BADI inconcistent called

    Hello friends, Does anyone have an idea on why a certain BADI is inconsistently called during the same process??? I'm trying to post GR using transaction MIGO and been wondering why does the BADI I used (MB_MIGO_BADI) is functioning as expected for t