Where-Clause-Question using "sets of values"

Hello,
I'm using 10gR2
Is it possible to filter rows by using sets of values in the where-clause?
E.g. like:
SELECT a, b, c
  FROM mytable
  WHERE (b,c) IN
      (3,4),
      (6,7),
      (9,1),
      (0,2)
    )...should only retrieve rows from mytable with the sets (pairs) of above list

Here is a link to the docs: [Expression Lists|http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions014.htm#i1033664]
!http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/img/expression_list.gif!
The number of expressions in each set must match the number of expressions before the operator in the comparison condition or before the IN keyword in the membership condition.

Similar Messages

  • Where clause question

    Hi Experts,
    We have a typical requirement for including the where clause dynamically. Here is the Scenario:
    We will be getting the Where Clause as a string parameter value from reporting framework. This needs to be appended in Crystal Reports with Select Clause.
    Here is an example. We will be getting the Where parameter value as
    clnt_id=1001 and acct_no=232 and cust='XYZ'
    This will be passed as a single string to CR which needs to act as Where Clause while the CR query hits database.
    Not sure how to implement this. Any suggestions will be of great help.
    Thanks
    Naresh

    As far as I'm aware, there are no other solutions, unless you want to parse the Where clause string in Crystal and code the possibilities.  This might be reasonable if there are only a couple of fields that possibly would be used in the where clause of any given report, but tedious and slow if there are hundreds.  Report performance will suffer in any case because the database will not be performing the Where clause, so more data will be passed back to Crystal which it will have to determine needs to be dropped.
    I don't know how many existing reports you're dealing with, but it might not be overly time consuming to change the reports to be based on an SQL Command.  After all, Crystal can give you the SQL that it intends to use when a report is defined based on tables and views...  IMHO, I see the benefit of using an SQL Command and have the database do the Where clause worth while in this case...
    HTH,
    Carl

  • Using "Set Control Value" to pass a reference

    Hi,
    every time I tried to passe a Control Reference using "Set Control Value" I have the Error 1 (invalid input parameter at invoke node). Why is it not possible to pass a control reference using the invoke node??
    Thanks
    Golzio

    Hi,
    This is possible. Trick is, the type of the control reference needs to be
    the same as the input. E.g. a string control reference is a different type
    as a numeric control reference (, or a control reference).
    To avoid this conflic, make sure the input of the vi is a control reference
    (and not a e.g. string control reference). Also make sure the to convert the
    reference you pass to a control reference (using Application Control>To More
    Generic Class).
    Regards,
    Wiebe.
    "Golzio" wrote in message
    news:506500000008000000C1F00000-1079395200000@exch​ange.ni.com...
    > Hi,
    > every time I tried to passe a Control Reference using "Set Control
    > Value" I have the Error 1 (invalid input parameter at invoke node).
    > Why is it not possible to pass a control re
    ference using the invoke
    > node??
    >
    > Thanks
    > Golzio

  • Set where Clause parameter using UIX

    I am using uiXML to generate a table which is associated to a ViewObject. The query of the ViewObject has bind variable for date. I would like to display a report (i.e table) with the values from ViewObject corresponding to dates (from & to) set using the bind variable. In other words, I would like to set the value for the bind variable from UIX just before displaying the table. My code is as follows:
    <bc4j:rootAppModuleScope name="QnAMainRepView1AppModule">
    <contents>
    <form name="QnAFrm">
    <contents>
    <bc4j:viewObjectScope name="QnAMainRepView1">
    <contents>
    <bc4j:table name="QnATbl" width="100%">
    <bc4j:keyStamp>
    <bc4j:rowKey name="key"/>
    </bc4j:keyStamp>
    <contents>
    <bc4j:column attrName="HostName">
    <columnHeader>
    <bc4j:sortableHeader text="Host"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="ModuleName">
    <columnHeader>
    <bc4j:sortableHeader text="Module"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="Description">
    <columnHeader>
    <bc4j:sortableHeader/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="Count1">
    <columnHeader>
    <bc4j:sortableHeader text="Count"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="Gmt">
    <columnHeader>
    <bc4j:sortableHeader text="GMT"/>
    </columnHeader>
    <contents>
    <bc4j:dateField readOnly="true">
    <onSubmitValidater>
    <date dateStyle="long"
    pattern="MM-dd-yyyy 'at' hh:mm:ss"/>
    </onSubmitValidater>
    </bc4j:dateField>
    </contents>
    </bc4j:column>
    <column>
    <columnHeader>
    <sortableHeader text="Local Time"/>
    </columnHeader>
    <contents>
    <dateField readOnly="true" value="2003-01-25">
    <onSubmitValidater>
    <date dateStyle="long"
    pattern="MM-dd-yyyy 'at' hh:mm:ss"/>
    </onSubmitValidater>
    </dateField>
    </contents>
    </column>
    </contents>
    </bc4j:table>
    </contents>
    </bc4j:viewObjectScope>
    </contents>
    </form>
    </contents>
    </bc4j:rootAppModuleScope>
    In the above, QnAMainRepView1 is the ViewObject which has bind variables. How do I set the value for the bind variable before the table is drawn?
    Thank you very much for your help.
    Jayasree

    I'm try implement this feature, but my Page return the follow error:
    oracle.jbo.SQLStmtException: JBO-27122: Error during preparation for instruction. Instruction: SELECT A.COD_CLIENTE, A.SEQ_ESCOLA, A.SEQ_CAMPUS, (select b.nom_escola from ed_escola b where a.cod_cliente = b.cod_cliente and a.seq_escola = b.seq_escola) AS DspNomEscola, A.STA_PRINCIPAL, A.COD_PESSOA, A.NOM_CAMPUS, A.STA_CNPJ, A.NUM_CNPJ, A.STA_FUNCIONAMENTO, A.TIP_DEPENDENCIA, A.TIP_ZONA, A.COD_GEOPROCESSAMENTO, A.QTD_M2_CONSTRUIDA, A.QTD_M2_TOTAL, A.NUM_DEPENDENCIA_OUES, A.NUM_CADASTRO_IMOB, A.COD_PESSOA_PRO, A.TIP_ESGOTO_SANITARIO, A.TIP_OCUPACAO_IMOVEL, A.TIP_ESFERA_PESSOA_PRO, A.SEQ_ESCOLA_DEP, A.SEQ_TIPO_LOCAL_CAMPUS, A.COD_CLASSE_LOCAL_CAMPUS, A.SEQ_TIPO_DESTINO_LIXO, A.COD_CLASSE_DESTINO_LIXO FROM ED_ESCOLA_CAMPUS A WHERE cod_cliente = ?
    at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:608)
    at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:2600)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:521)
    at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2197)
    at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1141)
    at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:2240)
    at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:4345)
    at oracle.cabo.data.jbo.ui.data.RowSetDataProvider.init(Unknown Source)
    at oracle.cabo.ui.data.provider.TableDataProvider.init(Unknown Source)
    at oracle.cabo.ui.data.provider.CachingDataProvider.init(Unknown Source)
    at oracle.cabo.ui.data.provider.DataProviderStack.addDataProvider(Unknown Source)
    at oracle.cabo.ui.LogicalNodeRenderingContext.addDataProvider(Unknown Source)
    at oracle.cabo.ui.composite.CompositeRenderingContext.addDataProvider(Unknown Source)
    at oracle.cabo.ui.laf.base.DataScopeRenderer.prerender(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.composite.UINodeRenderer.renderWithNode(Unknown Source)
    at oracle.cabo.ui.composite.UINodeRenderer.render(Unknown Source)
    My ViewObject have the SQL Statment:
    select a.cod_cliente,
    a.seq_escola,
    a.seq_campus,
    from ed_escola_campus a
    where cod_cliente = ?
    package br.com.siadem.siaed.ed00010;
    import javax.servlet.ServletConfig;
    import oracle.jbo.ViewObject;
    import oracle.cabo.ui.RenderingContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.servlet.ui.BajaRenderingContext;
    import oracle.cabo.data.jbo.servlet.bind.ServletBindingUtils;
    My Event Handler:
    public class FunPreQuery
    public EventResult handleEvent(BajaContext context, Page page, PageEvent event) throws Throwable
    ViewObject view = ServletBindingUtils.getViewObject(context);
    view.setWhereClauseParam(0, "1");
    view.executeQuery();
    return new EventResult(page);
    My Page UIX:
    <?xml version="1.0" encoding="windows-1252" ?>
    <page xmlns="http://xmlns.oracle.com/uix/controller"
    xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
    xmlns:ui="http://xmlns.oracle.com/uix/ui"
    xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j" >
    <bc4j:registryDef>
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="siaed.Ed00010Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1"
    rangeSize="10" >
    <bc4j:rowDef name="UpdateEdEscolaCampusView1" autoCreate="false" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    <content>
    <try xmlns="http://xmlns.oracle.com/uix/ui"
    xmlns:data="http://xmlns.oracle.com/uix/ui" >
    <catch>
    <displayException />
    </catch>
    <contents>
    <!--
    <switcher childName="default">
    <boundAttribute name="childName">
    <if>
    <comparison type="equals">
    <dataObject select="key" source="ctrl:page"/>
    <dataObject source="ui:null"/>
    </comparison>
    <fixed text="error"/>
    </if>
    </boundAttribute>
    <case name="error">
    <header text="Required page property 'key' missing. Cannot display page."/>
    </case>
    <case name="default">
    -->
    <pageLayout xmlns="http://xmlns.oracle.com/uix/ui"
    xmlns:data="http://xmlns.oracle.com/uix/ui"
    title="Campus - Pesquisar" >
    <contents>
    <!-- this will contain any validation errors after form
    submission -->
    <messageBox automatic="true" />
    <bc4j:rootAppModuleScope name="EdEscolaCampusView1AppModule" >
    <contents>
    <header text="Pesquisar" >
    <contents>
    <form name="search" method="POST" >
    <contents>
    <inlineMessage prompt="Condição" vAlign="middle" >
    <contents>
    <flowLayout>
    <contents>
    <choice name="attrName"
    data:selectedValue="attrName@ctrl:page"
    shortDesc="Search Column">
    <contents>
    <option text="Escola" value="SeqEscola" />
    <option text="Código Campus" value="SeqCampus" />
    <option text="Nome" value="NomCampus" />
    </contents>
    </choice>
    <textInput name="attrValue" columns="20"
    data:text="attrValue@ctrl:page"
    shortDesc="Search"/>
    </contents>
    </flowLayout>
    </contents>
    <end>
    <submitButton text="Pesquisar" ctrl:event="search" />
    </end>
    </inlineMessage>
    </contents>
    </form>
    </contents>
    </header>
    <header text="Resultados" >
    <contents>
    <form name="viewForm" method="POST" >
    <contents>
    <tableLayout>
    <contents>
    <bc4j:viewObjectScope name="EdEscolaCampusView1" >
    <contents>
    <bc4j:table name="viewTable" width="80%"
    alternateText="Nenhum registro encontrado">
    <tableSelection>
    <!-- single selection for each row in the table -->
    <singleSelection selectedIndex="0" shortDesc="Select Row">
    <contents>
    <!-- the update button causes the currently selected
    row to be sent to the update page -->
    <submitButton text="alterar"
    ctrl:event="update" />
    <!-- the delete button causes the currently selected
    row to be removed -->
    <submitButton text="excluir"
    ctrl:event="delete" />
    </contents>
    </singleSelection>
    </tableSelection>
    <!-- the key identifying the current row in the table -->
    <bc4j:keyStamp>
    <bc4j:rowKey name="key" />
    </bc4j:keyStamp>
    <contents>
    <!-- A bc4j:column element is added for each attribute
    in the ViewObject. -->
    <bc4j:column attrName="SeqEscola">
    <columnHeader>
    <bc4j:sortableHeader text="Escola"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    <bc4j:column attrName="SeqCampus">
    <columnHeader>
    <bc4j:sortableHeader text="Campus"/>
    </columnHeader>
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>
    </contents>
    </bc4j:table>
    </contents>
    </bc4j:viewObjectScope>
    </contents>
    </tableLayout>
    </contents>
    </form>
    </contents>
    </header>
    </contents>
    </bc4j:rootAppModuleScope>
    </contents>
    <contentFooter>
    <!-- the create button redirects to the create page -->
    <button text="Inserir" ctrl:event="inserir" />
    </contentFooter>
    </pageLayout>
    </contents>
    </try>
    </content>
    <handlers>
    <event name="*">
    <method name="br.com.siadem.siaed.ed00010.FunPreQuery"
    method="handleEvent"/>
    </event>
    <event name="search" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- search for the view criteria -->
    <bc4j:findByExample>
    <bc4j:exampleRow ignoreCase="true" >
    <bc4j:exampleAttribute>
    <bc4j:nameBinding><bc4j:parameter name="attrName" /></bc4j:nameBinding>
    <bc4j:valueBinding><bc4j:parameter name="attrValue" /></bc4j:valueBinding>
    </bc4j:exampleAttribute>
    </bc4j:exampleRow>
    </bc4j:findByExample>
    <bc4j:executeQuery/>
    <!-- store the current search criteria as page properties -->
    <bc4j:setPageProperty name="attrName" >
    <bc4j:parameter name="attrName" />
    </bc4j:setPageProperty>
    <bc4j:setPageProperty name="attrValue" >
    <bc4j:parameter name="attrValue" />
    </bc4j:setPageProperty>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    <event name="sort" source="viewTable" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- sort by the submitted attribute name -->
    <bc4j:sort/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    <event name="goto" source="viewTable" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- navigate to the submitted range -->
    <bc4j:goto/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    <event name="create" >
    <!-- forward to the create page -->
    <ctrl:go name="ed00010create" redirect="true" />
    </event>
    <event name="update" >
    <!-- forward to the update page, passing the selected key
    as a page property -->
    <ctrl:go name="ed00010update" redirect="true" >
    <ctrl:property name="key" >
    <ctrl:selection name="viewTable" key="key" />
    </ctrl:property>
    </ctrl:go>
    </event>
    <event name="delete" >
    <!-- using the ApplicationModule causes it to be checked out from the
    ApplicationPool. It is released using stateful mode. -->
    <bc4j:findRootAppModule name="EdEscolaCampusView1AppModule" >
    <!-- establish the ViewObject scope -->
    <bc4j:findViewObject name="EdEscolaCampusView1" >
    <!-- find the selected Row -->
    <bc4j:findRowByKey>
    <bc4j:keyBinding>
    <bc4j:selectionKey name="viewTable" key="key" />
    </bc4j:keyBinding>
    <bc4j:handlers>
    <!-- remove the selected ViewObject row -->
    <bc4j:removeRow />
    <!-- execute the query to eliminate dead row access -->
    <bc4j:executeQuery/>
    </bc4j:handlers>
    </bc4j:findRowByKey>
    </bc4j:findViewObject>
    <!-- commit the transaction, forwards to self automatically -->
    <bc4j:commit/>
    </bc4j:findRootAppModule>
    </event>
    </handlers>
    </page>
    Any body have a any idea for solution this problem ???
    thanks,
    Danilo

  • Filter Records in WHERE clause iReports using values passed from a prgram

    I have searched for iReports manual and what i can see are docs on sale. I have managed to create jrxml file, execute it in jsp and actually view the report.
    Now i have a big list of customers from various branches and have various categories. I would like to know how to pass the parameters so that i retrieve a small list of items. e.g. WHERE cu.branch=200 AND cu.category=10. That is i would like to pass 20 and 10 to the jrxml query stored.
    In iReports i saw parameters, variables and fields but it seems like these are displayable fields.
    How will i achieve this. Am seeking for assistance.
    null

    >
    Please help me to use an associate array in SQL query (WHERE clause).
    select *
    bulk collect into some_array
    >
    there is no variable 'some_array' in what you posted.
    If you want help with your code you have to post the code you are really using, not some hacked-up version of it that has errors.
    Here is sample code that shows how to treat a collection as a table using the TABLE operator
    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
    declare
    tb emp_table_type;
    deptnoList sys.OdciNumberList;
    BEGIN
    select emp_scalar_type(empno, ename, job, mgr, hiredate, sal, comm, deptno)
    bulk collect into tb from emp;
    SELECT deptno bulk collect
    INTO deptnoList
    FROM dept where deptno not in (select deptno from table(tb));
    for i in 1..deptnoList.count loop
    dbms_output.put_Line(deptnoList(i));
    end loop;
    END;Note that tb is a collection and is useds in the subquery 'select deptno from table(tb)'.

  • How to change access path for 'where' clause by using HINTS?

    I searched a loooot of posts and haven't found a solution for my case. I don't even know whether it is possible or not. Is it possible to change the sequence of Oracle "Predicate Information"?
    Here is my SQL and Oracle's execution plan.
      SELECT Max(logId) AS logId FROM online_users_t
      WHERE online_users_date >= to_date('2011-09-19 10:00:00') - 3.2 AND online_users_date <= to_date('2011-09-19 10:00:00') AND online_users_result in (1, -1)
      GROUP BY online_users_user
    | Id  | Operation                    | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                    | 24800 |   629K|  1336   (1)| 00:00:17 |
    |   1 |  HASH GROUP BY               |                    | 24800 |   629K|  1336   (1)| 00:00:17 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| ONLINE_USERS_T     | 38833 |   985K|  1334   (1)| 00:00:17 |
    |*  3 |    INDEX RANGE SCAN          | ONLINE_USERS_T_IDX |   116K|       |   313   (1)| 00:00:04 |
    Predicate Information (identified by operation id):
       2 - filter("ONLINE_USERS_RESULT"=(-1) OR "ONLINE_USERS_RESULT"=1)
       3 - access("ONLINE_USERS_DATE">=TO_DATE(' 2011-09-16 05:12:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "ONLINE_USERS_DATE"<=TO_DATE(' 2011-09-19 10:00:00', 'syyyy-mm-dd
                  hh24:mi:ss'))I have 2 conditions in my 'where' clause, one is date range and the other is 'online_users_result in (1, -1)'. It seems that Oracle filter the table by using 'online_users_result in (1, -1)' first, then access it through date range.
    What I want to do is firstly filtering the table by using date range followed by other things. How can I do it?
    Any clue or help would be highly appreciated.
    Thanks in advance.

    It seems that Oracle filter the table by using 'online_users_result in (1, -1)' first, then access it through date range. No it's not.
    What I want to do is firstly filtering the table by using date range followed by other things. How can I do it?That's precisely what it's doing now.
    It is using the T_IDX index to quickly find all rows that satisfy the range predicate on the date column.
    And then filter those rows to only retrieve the ones that satisfy the other predicate (... in (1,-1)).

  • Where clause and using dates

    Hi all,
    How to use the where clause to select records based on condition,,,,, and this condition is based on a date,, for example:
    select items from inventory_items
    where purchasing_date in :from_date and :to_date;
    Thank you very much
    Tasneem

    Tasneem wrote:
    Hi all,
    How to use the where clause to select records based on condition,,,,, and this condition is based on a date,, for example:
    select items from inventory_items
    where purchasing_date in :from_date and :to_date;
    Thank you very much
    Tasneemtry this..
    select items from inventory_items
    where purchasing_date between :from_date and :to_date;
    If someone's response is helpful or correct, please mark helpful or correct.

  • Code to segment  using set of values

    Hello all,
    I need to develop a program which has a predefined set of properties like area, perimeter, circularity,centroid, mean, varience values of an object in an image . I need to compare or segment by using these known values with that of the image object values. for example if the known object has an area of 12micro meter, then i should compare this value with that of the object which i check, if that has this value then i can segment otherwise i will not consider this value.
    if u have any idea about this please help me..
    armc

    U may use reflections and also instance checking ...

  • Dimension Mapping in 11g. Can Where clause be used to filter source table?

    Hi,
    Is it possible to use a where clause filter when mapping a dimension to source table in AWM 11g
    My understanding of the user guide is that filters can only be used in cube mapping?
    I am using AWM 11.2.0.1.0A on db 11g R2.
    I presume I could use a database view on the source table to filter down to the records for the dimension, however, I understand this would then prevent me refreshing any cube using this dimension using materialized view refresh?
    Thanks

    Yes, you can apply a where clause on a dimension map, but it is not exposed through AWM. You would need to add an attribute to the XML of the form
    WhereClause='<source table condition>'For example, you could add this to a HierarchyLevelMap.
    <HierarchyLevelMap
      WhereClause="CUSTOMER_DIM.SHIP_TO_ID = 123"
      KeyExpression="CUSTOMER_DIM.SHIP_TO_ID"
      Query="CUSTOMER_DIM">
    </HierarchyLevelMap>Make sure you add it to all relevant levels in a hierarchy. E.g. all levels that share the same source table. This is compatible with MV refresh. You can also map it to a view containing the where clause, and that, too, should work with MV refresh.

  • NodeJS Table Storage where clause prefix with numeric string value

    I am looking to make a TableQuery that returns results where a string property starts with a number. I have attempted to use the same prefix method
    described on the MSDN but I cannot get any results returned when the characters are numeric.
    Here is an example of what I'm trying to do:
        titleQuery = new azure.TableQuery()
        .and 'title ge ?', '1'
        .and 'title lt ?', '2'
    Sample title values are "1-something", "something", and "123-something"
    Looking at the comments in source, I can see that the query API has been updated, but don't see any examples of doing queries based on prefix.
    Any thoughts on how or if this is possible?
    David Wesst | MVP http://davidwesst.com | @davidwesst

    Received a reply on the GitHub issues site, where I asked the same question.
    It appears the issue was a simple oversight by me where I used two '.and' operators instead of a '.where' and an '.and'.
    https://github.com/Azure/azure-storage-node/issues/30#issuecomment-61926225
    Thanks!
    David Wesst | http://davidwesst.com | @davidwesst

  • Where will i use SET-PF-STATUS?

    HOW TO CREATE MENUBAR,TITILE BAR,APPLICATION? IN MY PROGRAM BELOW.......
    REPORT YINTERACTIVEPROGRAM02 NO STANDARD PAGE HEADING.
    TABLES:YEMPLOYEE,YEMPLOYEEDB.
    TYPES: BEGIN OF TY_EMPLOYEE,
            EMP_ID TYPE YEMPLOYEE-EMP_ID,
            EMP_NAME TYPE YEMPLOYEE-EMP_NAME,
            EMP_ADDR TYPE YEMPLOYEE-EMP_ADDR,
            EMP_PROFILE TYPE YEMPLOYEE-EMP_PROFILE,
          END OF TY_EMPLOYEE.
    DATA:I_EMPLOYEE TYPE STANDARD TABLE OF TY_EMPLOYEE WITH HEADER LINE.
    START-OF-SELECTION.
      SELECT * FROM YEMPLOYEE INTO CORRESPONDING FIELDS OF TABLE I_EMPLOYEE.
      LOOP AT i_EMPLOYEE.
        WRITE: I_EMPLOYEE-EMP_ID,'               ',
               I_EMPLOYEE-EMP_NAME,'        ',
               I_EMPLOYEE-EMP_ADDR,'       ',
               I_EMPLOYEE-EMP_PROFILE.
               HIDE:I_EMPLOYEE-EMP_ID.
               SKIP.
      ENDLOOP.
    TOP-OF-PAGE.
      WRITE: 'PRODUCT INFORMATION'.
      SKIP.
      WRITE: 'EMPLOYEE ID      ',
             'EMPLOYEE NAME    ',
             'EMPLOYEE ADDR                        ',
             'EMPLOYEE PROFILE'.
      ULINE.
    END-OF-PAGE.
      WRITE: 'ENJOY'.
    END-OF-SELECTION.
    AT LINE-SELECTION.
      CHECK SY-LSIND = 1.
      WINDOW STARTING AT 10 5
             ENDING AT   99 12.
      WRITE: 'YOU HAVE SELECTED ITEM:'.
      ULINE.
      WRITE: 'EMPLOYEE ID      ',
             'EMPLOYEE NAME    ',
             'EMPLOYEE ADDR                  ',
             'EMPLOYEE PROFILE'.
      ULINE.
      SKIP.
      WRITE:SY-LISEL.
      ULINE.
      SELECT * FROM YEMPLOYEEDB WHERE EMP_ID = I_EMPLOYEE-EMP_ID.
        WRITE:'EMP_AGE  '.
        WRITE:'EMP_GENDER'.
        SKIP.
        WRITE:YEMPLOYEEDB-EMP_AGE.
        WRITE:'         '.
        WRITE:YEMPLOYEEDB-EMP_GENDER.
      ENDSELECT.
      IF SY-SUBRC <> 0.
        WRITE:  'NO DATA FOR SELECTED ITEM'.
      ENDIF.

    Hi,
    Sets a GUI (Graphical User Interface) status pfstat which can be up to 20 characters long. There are many of these statuses in the GUI of a program. Each one describes which functions are available and how you can select these via menus and menu bars or by pressing function keys or pushbuttons. For further information about this, refer to the Menu Painter documentation.
    Each status has a name which may be up to 8 characters long.
    Setting a status makes the functions contained therein selectable.
    This method allows you to vary the available functions according to the current screen, list level and/or previous program flow.
    The current status is stored in the system field SY-PFKEY.
    A status remains valid for the duration of a transaction or until you set a new status.
    Note
    You can use a namespace prefix with status names.
    Example
    Event in program:
    START-OF-SELECTION.
      SET PF-STATUS 'MAIN'.
      WRITE SY-PFKEY.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'F001'.
          SET PF-STATUS '0001'.
          WRITE SY-PFKEY.
      ENDCASE.
    Produces a list (contents MAIN) with a GUI framework which allows you to select functions assigned to the the status MAIN. If you choose the function code F001 (e.g. from the menu or by pressing a pushbutton), you trigger the event AT USER-COMMAND. This generates a secondary list (contents 0001) with a GUI framework which allows you to select functions assigned to the status 0001. On returning from the secondary list to the basic list the status MAIN is reactivated.
    Example
    PBO module:
    MODULE PBO_100 OUTPUT.
      SET PF-STATUS 'S001'.
    ENDMODULE.
    Displays the screen 100 with a GUI framework which allows you to select functions assigned to the status S001.
    Note
    If you want to set a status for a screen, you must do so during the PBO event. The system always searches for the status pfstat in the GUI of the main program of the current program group . (However, see also the addition OF PROGRAM progname.)
    Example
    PROGRAM PROGRAM1.
    PERFORM UP1 IN PROGRAM PROGRAM2.
    PROGRAM PROGRAM2.
    FORM UP1.
    SET PF-STATUS 'ABCD'
    ENDFORM:
    The status ABCD of program PROGRAM1 is activated if PROGRAM1 is the program specified in the transaction definition.
    Notes
    If no GUI is defined in the list processing (or it is deactivated with SET PF-STATUS SPACE), the system supplies a standard user interface.
    This statement converts the contents of the field pfstat to type C. The converted value is used to search for the desired status. Since the conversion employs the standard conversion rules as for MOVE, you should use a field of type C for pfstat to avoid unwanted conversions. In this case, a field of type I with a value of 12 would give the key ' 12 '.
    Addition 1
    ... EXCLUDING f ... EXCLUDING itab
    Effect
    Deactivates one or more of the status functions, so that they cannot be selected. Specify the appropriate function codes using one of the following:
    a field f or a literal which contains a function code
    an internal table itab which contains several function codes
    This method allows you to modify the selectable functions of a status easily at runtime.
    Example
    DATA: itab TYPE TABLE OF sy-ucomm.
    APPEND 'DELE' TO itab.
    APPEND 'PICK' TO itab.
    SET PF-STATUS 'STA3' EXCLUDING itab.
    Sets the status STA3 which renders the functions with the function codes DELE and PICK inactive.
    Addition 2
    ... IMMEDIATELY
    Effect
    List processing: The status becomes effective for the last list displayed and is not flagged for the next secondary list. In screen processing, this addition has no effect because every status becomes immediately effective anyway.
    Example
    Event in program:
    START-OF-SELECTION.
      SET PF-STATUS 'MAIN'.
      WRITE SY-PFKEY.
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'F002'.
          SET PF-STATUS '0002' IMMEDIATELY.
          EXIT.
      ENDCASE.
    Selecting the function F002 in the basic list (contents MAIN, status MAIN) redisplays the basic list, but this time with the status 0002.
    Note
    Without the addition ... IMMEDIATELY, the old status MAIN becomes active again.
    Addition 3
    ... OF PROGRAM progname
    Effect
    The system does not look for the status pfstat in the GUI of the main program of the current program group, but in the program whose name is specified in the field progname.
    Note
    Only use this addition if the status contains no dynamic texts.
    Since the system searches for the texts in the program to which the status belongs (that is, in program progname) the calling program will not be able to fill the dynamic texts. External statuses containing dynamic texts should be assigned to a function group, and activated by a function module that both fills the dynamic text fields and sets the status.
    Example
    DATA PROGR LIKE SY-REPID.
    MOVE 'TESTPROG' TO PROG.
    SET PF-STATUS 'ABCD' OF PROGRAM PROG.
    The system activates the status ABCD of program TESTPROG.
    Note
    You can use the OF PROGRAM addition in conjunction with the EXCLUDING itab and IMMEDIATLEY additions.
    Regards,
    PRitha.
    Reward if helpful

  • Beginner ALV Grid question (using OO) "Possible Values" doesn't do anything

    Hi,
    I have a working ALV Grid report using the 'CL_CALV_TABLE' class, and FACTORY DISPLAY method.
    Standard Functions are working, got single-click events programmed to drill-down into documents, key columns, etc.
    So the report output seems fine.
    <i>However, some columns / cells have a "possible values" icon, but when selected nothing happens. And some columns have the icon, for example, Material, Co.Code, but then others don't. </i>
    I've looked at example report SALV_DEMO_TABLE_COLUMNS and SALV_TEST_FUNCTIONS, but I can't see any specific code in there that controls this.
    <u>Would appreciate it if anyone can confirm:</u>
    a) what triggers the icon to appear for some columns/cells but not others? Is it the TYPE of the table column?
    b) is any coding needed for the "Possible values" window to popup?
    TIA,
    James

    Seems like f4availabl field is enabled in field catalog.

  • Using multiple values in a where clause, for values only known at runtime

    Dear all
    I am creating a PL/SQL program which returns multiple rows of data but only where it meets a set id values that a user has previously chosen. The id values are stored in an associative array and are chosen by a user in the preceding procedure at run time.
    I know all the table and column names in advance. The only things I don't know are the exact number of ids selected from the id column and what their values will be. This will only be known at runtime. When the procedure is run by the user it prints multiple rows of data to a web browser.
    I have been reading the following posting, which I understand to a large extent, Query for multiple value search But I cannot seem to figure out how I would apply it to my work as I am dealing with multiple rows and a cursor.
    The code as I have currently written it is wrong because I get an error not found message in my web browser. I think the var_user_chosen_map_list_ids in the for cursor loop could be the problem. I am using the variable_user_chosen_map_list_ids to store all the id values from my associatative array as a string. Which I modified from the code that vidyadhars posted in the other thread.
    Should I be creating a OPEN FOR ref cursor and if so where would I put my associative array into it? At the moment I take the value, turning it into a string and IN part in the WHERE clause holds the string, allowing the WHERE clause to read all the values from it. I would expect the where clause to read everything in the string as 1 complete string of VARCHAR2 data but this would not be the case if this part of the code at least was correct. The code is as follows:
    --Global variable section contains:
    var_user_chosen_map_list_ids VARCHAR2(32767);
    PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
    IS
    CURSOR cur_map_search (par_user_chosen_map_list_ids IN NUMBER)
    IS
    SELECT MI.map_date
           MT.map_title,
    FROM map_info MI,
         map_title MT,
    WHERE MI.map_title_id = MT.map_title_id
    AND MI.map_publication_id IN
    (var_user_chosen_map_list_ids);
    var_map_list_to_compare VARCHAR2(32767) := '';
    var_exe_imm_map VARCHAR2(32767);
    BEGIN
    FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
    LOOP
       var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
       '''' ||
       par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
    END LOOP;
    var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                            1,
                                            length(var_user_chosen_map_list_ids)-1);
    var_exe_imm_map := 'FOR rec_search_entered_details IN cur_map_search
    LOOP
    htp.print('Map date: ' || cur_map_search.map_date || ' Map title: ' || cur_map_search.map_title)
    END LOOP;';
    END PROCMAPSEARCH;EXECUTE IMMEDIATE var_exe_imm_map;
    I would be grateful of any comments or advice.
    Kind regards
    Tim

    I would like to thank everyone for their kind help.
    I have now successfully converted my code for use with dynamic SQL. Part of my problem was getting the concept confused a little, especially as I could get everything work in a static cursor, including variables, as long as they did not contain multiple values. I have learnt that dynamic sql runs the complete select statement at runtime. However even with this I was getting concepts confused. For example I was including variables and the terminator; inside my select string, where as these should be outside it. For example the following is wrong:
         TABLE (sys.dbms_debug_vc2coll(par_user_chosen_map_list_ids))....
    AND MI.map_publication_id = column_value;';Where as the following is correct:
         TABLE (sys.dbms_debug_vc2coll('||par_user_chosen_map_list_ids||'))....
    AND MI.map_publication_id = column_value';PL/SQL is inserting the values and then running the select statement, as opposed to running the select statement with the variables and then accessing the values stored in those variables. Once I resolved that it worked. My revised code is as follows:
    --Global variable section contains:
    var_user_chosen_map_list_ids VARCHAR2(32767);
    var_details VARCHAR(32767);
    PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
    IS
    BEGIN
    FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
    LOOP
       var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
       '''' ||
       par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
    END LOOP;
    var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
                                            1,
                                            length(var_user_chosen_map_list_ids)-1);
    var_details := FUNCMAPDATAFIND (var_user_chosen_map_list_ids);
    htp.print(var_details);
    END PROCMAPSEARCH;
    FUNCTION FUNCMAPDETAILS (par_user_chosen_map_list_ids IN VARCHAR2(32767)
    RETURN VARCHAR2
    AS
    TYPE cur_type_map_search IS REF CURSOR;
    cur_map_search cur_type_map_search;
    var_map_date NUMBER(4);
    var_map_title VARCHAR2(32767);
    begin:
    OPEN cur_map_search FOR
    'SELECT MI.map_date,
           MT.map_title
    FROM map_info MI,
         map_title MT,
         TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_map_list_ids || '))
    WHERE MI.map_title_id = MT.map_title_id
    AND MI.map_publication_id = column_value';
    LOOP
    FETCH cur_map_compare INTO
    var_map_date,
    var_map_title;
    var_details := var_details || 'Map date: '||
                        var_map_date ||
                        'Map title: ' ||
                        var_map_title;
    EXIT WHEN cur_map_compare%NOTFOUND;
    END LOOP;
    RETURN var_details;
    END FUNCMAPDETAILS;Kind regards
    Tim

  • Creating WHERE clause for an outer join using DatabaseFilter

    Hi all,
    I read a post on thie group about constructing the WHERE clause for a RowSet Controls
    SQL Query using the DatabaseFilter and this is what it said:
    ****************************************************************************The
    following example shows adding part of a WHERE clause in an action method of a
    page flow:
    DatabaseFilter.FilterTerm term = new DatabaseFilter.FilterTerm(); term.sColumnName
    = "name"; term.op = DatabaseFilter.opContains; // there are ops for equals, less
    than, etc... term.value = form.getPartialName();
    // You can also add sort terms for an ORDER BY clause allNames = dbControl.getNames(new
    DatabaseFilter(new DatabaseFilter.FilterTerm[] {term}, null));
    I am trying to create a where clause which uses a join like this:
    Select * from x,y where x.id=y.id (+)
    ie. All values from x.id but only corrosponding ones from y.id.
    Is there any way to build this outer join query using the DatabaseFilter class
    or am i forced to use a String which is contruct in my page flow as the where
    clause?like so:
    * @jc:sql command-type="grid"
    * rowset-name="RFPSRowSet"
    * max-rows="1000"
    * statement::
    * SELECT RFPS.RFP_ID,RFPS.NAME AS RFP_NAME,RFPS.FFO_NUMBER,RFPS.RFP_TYPE,RFPS.CFDA_NUMBER,COMPETITIONS.NAME
    AS COMP_NAME,COMPETITIONS.COMPETITION_ID FROM RFPS,COMPETITIONS WHERE {sql: whereClause
    } {sql: filter.getOrderByClause ()}
    public RowSet getAllRfps(java.lang.String whereClause,DatabaseFilter filter)
    throws SQLException;
    and in my pageFlow action, i do the following:
    StringBuffer whereClause= new StringBuffer();
    whereClause.append("RFPS.RFP_ID = COMPETITIONS.RFP_ID (+)");
    if ((form.getRfpTitle() != null) &&
    (!form.getRfpTitle().equalsIgnoreCase("")))
    whereClause.append(" AND UPPER(RFPS.NAME) LIKE %"+form.getRfpTitle().toUpperCase());
    if ((form.getCfdaNumber() != null) &&
    (!form.getCfdaNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.CFDA_NUMBER ="+form.getCfdaNumber());
    if ((form.getFfoNumber() != null) &&
    (!form.getFfoNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.FFO_NUMBER ="+form.getFfoNumber());
    sortFilterService = SortFilterService.getInstance(getRequest());
    DatabaseFilter filter=sortFilterService.getDatabaseFilter(getGridName());
    log.debug("***********"+whereClause.toString()+"***********");
    allRows = searchRfaAndComp.getAllRfps(whereClause.toString(),filter);
    Thanks in advance for your help,
    Regards,
    Vik.

    Thanks for your reply. Just one more question....if we indeed are trying to use
    a simple query and have a where clause like "select * from x where upper(x) like
    {x}", how do we set the UPPER filter on the column using the database filter?
    I see a IDENTIFIER.ISUPPER static field on that DatabaseFilter but am unsure how
    to use it. Would appreciate any pointers .
    Thanks again,
    Vik
    Eddie O'Neil <[email protected]> wrote:
    Vik--
    I believe that the approach that you describe below is the best one
    for dealing with outer joins
    with the DatabaseFilter.
    Apologies for the limitation...
    Eddie
    vik wrote:
    Hi all,
    I read a post on thie group about constructing the WHERE clause fora RowSet Controls
    SQL Query using the DatabaseFilter and this is what it said:
    ****************************************************************************The
    following example shows adding part of a WHERE clause in an actionmethod of a
    page flow:
    DatabaseFilter.FilterTerm term = new DatabaseFilter.FilterTerm(); term.sColumnName
    = "name"; term.op = DatabaseFilter.opContains; // there are ops forequals, less
    than, etc... term.value = form.getPartialName();
    // You can also add sort terms for an ORDER BY clause allNames = dbControl.getNames(new
    DatabaseFilter(new DatabaseFilter.FilterTerm[] {term}, null));
    I am trying to create a where clause which uses a join like this:
    Select * from x,y where x.id=y.id (+)
    ie. All values from x.id but only corrosponding ones from y.id.
    Is there any way to build this outer join query using the DatabaseFilterclass
    or am i forced to use a String which is contruct in my page flow asthe where
    clause?like so:
    * @jc:sql command-type="grid"
    * rowset-name="RFPSRowSet"
    * max-rows="1000"
    * statement::
    * SELECT RFPS.RFP_ID,RFPS.NAME AS RFP_NAME,RFPS.FFO_NUMBER,RFPS.RFP_TYPE,RFPS.CFDA_NUMBER,COMPETITIONS.NAME
    AS COMP_NAME,COMPETITIONS.COMPETITION_ID FROM RFPS,COMPETITIONS WHERE{sql: whereClause
    sql: filter.getOrderByClause ()}* ::
    public RowSet getAllRfps(java.lang.String whereClause,DatabaseFilter
    filter)
    throws SQLException;
    and in my pageFlow action, i do the following:
    StringBuffer whereClause= new StringBuffer();
    whereClause.append("RFPS.RFP_ID = COMPETITIONS.RFP_ID (+)");
    if ((form.getRfpTitle() != null) &&
    (!form.getRfpTitle().equalsIgnoreCase("")))
    whereClause.append(" AND UPPER(RFPS.NAME) LIKE %"+form.getRfpTitle().toUpperCase());
    if ((form.getCfdaNumber() != null) &&
    (!form.getCfdaNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.CFDA_NUMBER ="+form.getCfdaNumber());
    if ((form.getFfoNumber() != null) &&
    (!form.getFfoNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.FFO_NUMBER ="+form.getFfoNumber());
    sortFilterService = SortFilterService.getInstance(getRequest());
    DatabaseFilter filter=sortFilterService.getDatabaseFilter(getGridName());
    log.debug("***********"+whereClause.toString()+"***********");
    allRows = searchRfaAndComp.getAllRfps(whereClause.toString(),filter);
    Thanks in advance for your help,
    Regards,
    Vik.

  • ADF dynamic where clause for VO query using BC

    I'm hoping someone can help me out. I have a read only view object that I want to filter results based on some user choices. For example the user may want to see all results or they may only want to see a much smaller subset. This is for an error dashboard, the smaller subset maybe by application or maybe by application and by error severity. I think I can use a dynamic where clause but I'm not sure, Can someone get me started down the right path, or post an example that I can see.

    Hi user,
    You can use a dynamic where clause for this, but maybe there is a more practical option. Maybe you can have a fixed where clause, but using a bind parameter, like:
    vo.application like :applicationParam. This makes an executeWithParams method available that you can call from your page, and use in the bindings. This parameter you can populate with the results of for example a poplist, with a default value of '%'.
    When you do want to use a dynamic where clause, you will need to add a method to the java code of your application module, and make this method available for the client. In this method, you can use findViewObject to retrieve your VO, use VO.setWhereClause to set the whereclause to what you want, and then call VO.executeQuery. This method can then again be called from the page.
    Success,
    Jeroen van Veldhuizen

Maybe you are looking for

  • FM Radio Application for Windows 8

    I am trying to develop a simple FM Radio Application for Windows 8 phones. I found one class but it says it will not work for devices targeting windows 8. Can some one please help.  https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.devi

  • BAPI_GOODSMVT_CREATE and Batch Determination

    Hi experts! I'm new to batch determination and I'm facing an issue. I've set up a batch determination configuration and it works fine when I post a goods issue in dialog process (MB1A) entering * in the batch field. Now I'm trying to do the same with

  • Issue with ABAP program execution from process chains

    Hi All: We have a process chain with 3 steps, each of them executing the same program with three different variants. The program is ftp's the file from APO's dataexchange (mount) to another ftp server. The first variant transfers file A to a director

  • Scrollbar in a datatable

    Hi can anyone please tell me what im doing wrong. Iv been trying to put a scroll bar in my datatable but havent managed it. Heres my datatable           <h:panelGrid styleClass="inset_table" rowClasses="verticalAlign" >                     <h:dataTab

  • CS 5.5 Crashes when I print

    We just upgraded our user to CS 5.5 from CS 4. He still has CS4 installed. When we go to print the item he's working on via "Print" the program crashes. When we click "Print options" that crashes. Alternatively when we print via "Print one page" that