Static Values in IN operator

Hi All,
Can we use static values with IN operator for multiple columns.
Ex :- I have a table tab_1 with col_1 and col_2.
If i try to execute the query
select * from tab_1 where
(col_1,col_2) in (val_1,val_2)
Iam getting invalid relational operator error message.
But
select * from tab_1 where
(col_1,col_2) in (select col_1,col_2 from tab_1)
Works Fine.
Pls help me to understand this problem.
Thanks & Regs
Dhananjaya.H

These are two different queries. The static list:
select * from tab_1 where
(col_1) in (1,2,3) means return all rows where COL_1 = 1 or COL_1 = 2 or COL_1 = 3. The syntax only allows one column as the argument in this sort of IN.
The variable list:
select * from tab_1 where
(col_1,col_2) in (select col_1,col_2 from tab_2)means return all rows where TAB_1.COL_1 = TAB_2.COL_1 and TAB_1.COL_2 = TAB_2.COL_2. In this case the number on arguments on the left hand side of the IN must match the number of arguments on the righthand side of the argument.
In other words this is not valid syntax either: select * from tab_1 where
(col_1,col_2) in (select col_1 from tab_2)If you want to test two columns against a static list you need separate clauses for each of them.
You may find the documentation helpful.
expression lists: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/expressions14a.htm#1029285
membership conditions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/conditions5a.htm#1013449
Cheers, APC

Similar Messages

  • Query Issue with adding a static value

    I have written a query in SAP that works the way I need it to. I am going to schedule it so that SAP does a file transfer of the output to another area where the data will be accumulated.
    My problem is that I want the name of the system to appear at the end of each line but it is not in any table I can find to match up with the userid.
    EX:
    UserID        Group                          System
    JDOE         HR Query Group            P201
    The field for system is not in any tables but I want to add it and give it a constant/static value all the time in the output.
    Any ideas?
    Thanks!
    Justin Dauby -- SAP Security Analyst
    Kimball International Inc.,

    The name of the system is not in a table, but rather a structure called SYST. You can evaluate it using the system field sy-sysid.
    Another option is to call function module RFC_SYSTEM_INFO. The export parameter RFCSI_EXPORT will deliver the system id from component RFCSYSID of the structure RFCSI.
    Cheers,
    Julius

  • BO Webi: How to populate a variable with the set of static values for Graph

    Hi All,
    I have the data: Order number, Order Date, processing time coming from the SAP Bex query in the below format:
    Order No    Order Date    Processing time (Days)
    1                 Jan-2011      4
    2                 Jan-2011      5
    3                 Feb-2011      6
    In BO webi report, I have to report the number of orders which were processed in <1day, <2days, <3days,...<10days in a graphical view. i.e., X-Axis:  <1day, <2days, <3days,...<10days(10 static buckets for the processing days)
    Y-Axis: Number of Orders.
    The graphical output should be like below:
    X-Axis: <1day, <2days, <3days,<4days,<5days,<6days,<7days,<8days,<9days,<10days
    Y-Axis: 0, 0,0,0,1,2,3,3,3,3  (count(Order No)) (Cumulative count)
    I am able to calculate the number of orders individually for each of the 10 buckets. But the problem i am facing is that I am not able to hold the 10 static bucket values in a variable to use it for the x-axis in the Graph, as these 10 static bucket values are not coming from the backend source.
    I would like to know if there is way to populate a variable(to use it for the X-Axis in the graph) with the set of 10 static values.
    Any help would be highly appreciated.
    Thanks,
    Leela

    Hi ,
    I think we can use the variable as X-axis in chart.. but Variable Qulaification should be Dimension.
    can you try this?.
    Using efasion universe
    1) Select month and Sold at (unit price) , then run the query
    2) create the variable V_Month ==If [Month]=1 Then "Month1" Else "Month2"  (Note = Variable Qulaification should be Dimension)
    3) Create the variable V_Sum= sum (Sold at (unit price))
    4) create another variable V_Cumulative_Sum==[V_Sum]+Previous([V_Sum])
    Now add V_Month and V_Cumulative_Sum in table , then convert to chart.. now you can add the variable V_Month as X-axis of the chart.
    Hope this will help:)
    Thanks
    Ponnarasu K

  • Evaluate function doesn't work with Static values

    Hi All,
    I have been trying to call a evaluate function and have been successfully in calling it..but i face problem when i pass any static values to it...
    For eg
    when i try calling the function using one of the columns...it works fine
    Evaluate('dbo.Hello(%1)',"Dim table_name"."Department" )
    the function normally changes it to upper case.so i get all the value in the column in department in upper case.
    but when i call any static value like
    Evaluate('dbo.Hello(%1)','hello') it throws the following error..
    [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 42015] Cannot function ship the following expression: Evaluate( dbo.Hello(%1),'hello') . (HY000)
    Can any one please help me in this
    Regards
    SK

    Which version of Jdev are you using? What are the results you are getting?

  • Dropdown box with query *and* static values?

    Hi guys,
    If I had a dropdown box with a LOV being generated from a query,
    Select distinct PERSON from USER_TABLE
    Bill
    Fred
    Steve
    Is it possibe to somehow add static values so that they sit permanently on top of what ever values are produced by the query?
    Null
    Not Null
    Bill
    Fred
    Steve
    Thanks,
    Neil.

    select 'Null' d, 'Null' r from dual
    union all
    select 'Not Null' d, 'Not Null' r from dual
    union all
    select distinct person d, person r from user_table
    ...like that?
    Scott

  • Setting up a static value in a field then saving it

    if i have the case of a field, and i add a dynamic action to set a static value for it (e.g. a status field and when accessing a certain form it should change the STATUS field to CONFIRMED as a static text), how do i make sure that this value gets saved into the database?
    meaning, when i create the assigned form and set the dynamic action to display the status (as a display only field) as "confirmed", when pressing the apply changes button nothing happens and the CONFIRMED status does not get saved into the database.

    Make sure the printer is at least 3 feet away from the router.  Now try here.
    Set a static IP in the printer (click here) outside the DHCP range of the router (check your manual). 
        This is for Linksys routers but can be used for all routers.  Verify your DHCP range and change this
        first if needed.  More Wireless Printing help is here.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • How to show static values in h:selectOneListbox

    Hi
    i would like to show static values in <h:selectOneListbox>
    how do i that ??
    <managed-bean>
    <managed-bean-name>Options</managed-bean-name>
    <managed-bean-class>java.util.ArrayList</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <list-entries>
    <value>val1</value>
    <value>val2</value>
    <value>val3</value>
    </list-entries>
    </managed-bean>
    or some how i define a <managed-property> ??
    <managed-property>
    <property-name>options</property-name>
    <property-class>java.util.ArrayList</property-class>
    <list-entries>
    <value>val1</value>
    <value>val2</value>
    <value>val3</value>
    </list-entries>
    </managed-property>

    Hi Swetlin,
    I have this format in the main window.
    textaaaaaaaaaaaaaaaaa
    textfffffffffffffff
    123
    1234
    1234
    5667
    1234
    textweeeeeeeeeeeeeeeeeeeeee
    texttryrtyrtuyrturtur
    now when i am doing as you suggested
    the last texts are coming in the next page.
    What i want is to show overflow of numeric data in next page and the remaining last text should remain as it is in the first page only.
    i mean
    textaaaaaaaaaaaaaaaaa
    textfffffffffffffff
    123
    1234
    1234
    5667
    1234
    textweeeeeeeeeeeeeeeeeeeeee
    texttryrtyrtuyrturtur
    and in the next page
    4567
    4568
    8790
    Thanks and regards
    Mave

  • How to use any cell as an static value

    Hello,
    I don't know if it is possible to use any cell as an static value, same as $ in excel, E$2$.
    I need to divide all the values of a table with a unique value of a cell. In excel is when you put $E$2, this make a cell an static value.
    This is possible en Web Intelligence?
    Best Regards
    SU

    Hello Srivatsa,
    Thanks for your response. An example could be the sum and divide by the sum (to calculate participation) of a table.
    2
    2
    3
    S=7
    Then I want to divide 2 by 7, 2 by 7 and 3 by 7. The Sum (in this case 7) is the static value, how can I use it for operate all the registries?
    To have,
    0.29
    0.29
    0.43
    Thanks & Regards
    SU

  • Populating static values in addition to database value in select one choice

    Hi All,
    We are using jdev 11.1.1.2.0.
    I am populationg a select one choice based on a read only VO. The vo is populating fine,but in addition to the values from the database I want to add two static values. I want to add 'select customer' and 'all customer'.
    Currently I am doing this using UNION in the sql query of my VO. WhenI add union in my sql query its taking more time to load the value from the database.
    Is this the proper adf way to do it? Is there someother way to attain it.
    Following is the query I am using to populate one of the VO's
    SELECT * FROM(
    SELECT ID,NAME,3 SORT_ORDER FROM CUSTOMER
    UNION
    SELECT -1,'SELECT CUSTOMER,1 FROM DUAL
    UNION
    SELECT -2,'ALL CUSTOMER,2 FROM DUAL)
    ORDER BY SORT_ORDER,NAME
    Please advice
    Susan

    Hi,
    You can do this usecase by populating the values to SelectOneChoice Programmatically.
    <af:selectOneChoice label="List"
    binding="#{MyTestBean.myTestListComponent}">
    <f:selectItems value="#{MyTestBean.listOfItems}"/>
    </af:selectOneChoice>
    backing bean code will be:
    public List<SelectItem> getListOfItems() {
    List<SelectItem> items= new ArrayList<SelectItem>();
    SelectItem si = new SelectItem();
    //if u trying to populate data from VO then u have set the values
    DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind = (DCIteratorBinding)dcBindings.get("DepartmentsView1Iterator");
    for(int i=0;i<iterBind.getEstimatedRowCount();i++)
    Row row = iterBind.getViewObject().getRowAtRangeIndex(i);
    if(row!=null)
    si = new SelectItem();
    si.setLabel((String)row.getAttribute("DepartmentName"));
    si.setValue(row.getAttribute("DepartmentId"));
    items.add(si);
    //here you can add the static values;
    si = new SelectItem();
    si.setLabel("Static Value1");
    si.setValue("Static1");
    items.add(si);
    si = new SelectItem();
    si.setLabel("Static Value2");
    si.setValue("Static2");
    items.add(si);
    return items;
    }

  • Which Function Should i use for static values for a an array[] in BPM 11g.

    Hi Experts,
    Please throw some light on this..
    I've a requirement which is bugging me..
    How do i assign a static value to a array in BPM11g in script activity. What exactly function do i need to use to assign a Static value for an Array []
    I been doing like taking the business object as a Array thats fine. But how can i set a static value in BPM 11g.
    Iam using BPM 11.1.1.6 version..
    Regards,
    Pavan

    Hi Pavan,
    Here's one approach, but it assumes you're comfortable with XSDs and XML.
    Know this is light on detail, but without knowing what your array looks like it's the best I can do. Here's what you'd do from a high level:
    1. Create an XSD that defines the structure of your array.
    2. Create the XML that represents the static item you want to add to the array.
    3. Create a process variable based on the XSD that defined the array.
    4. Add a Script activity.
    5. Open the "Implementation" tab -> click "Data Associations".
    6. On the right, expand the folder under your process -> drag the XML icon in the upper right corner on the array variable -> paste your XML into the XML literal panel.
    Hope this gets you going,
    Dan

  • Static values in SAML assertion

    In Saml 1.0, will it be possible to include static values in SAML assertion?

    These are two different queries. The static list:
    select * from tab_1 where
    (col_1) in (1,2,3) means return all rows where COL_1 = 1 or COL_1 = 2 or COL_1 = 3. The syntax only allows one column as the argument in this sort of IN.
    The variable list:
    select * from tab_1 where
    (col_1,col_2) in (select col_1,col_2 from tab_2)means return all rows where TAB_1.COL_1 = TAB_2.COL_1 and TAB_1.COL_2 = TAB_2.COL_2. In this case the number on arguments on the left hand side of the IN must match the number of arguments on the righthand side of the argument.
    In other words this is not valid syntax either: select * from tab_1 where
    (col_1,col_2) in (select col_1 from tab_2)If you want to test two columns against a static list you need separate clauses for each of them.
    You may find the documentation helpful.
    expression lists: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/expressions14a.htm#1029285
    membership conditions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/conditions5a.htm#1013449
    Cheers, APC

  • Formula to fill standard value in RC operation

    Hello,
    We are using serial number  effectivty parameter . We were asked to fill one of the standard values of  the RC operation , using a formula, thus each serial number will contain a different value, that will be calculated according to to formula.
    For example: S.N 1 will contain the value 20 ,  S.N 2 will contain the value 19.7,  S.N 3 will contain the value 19.4 etc.
    Is there any standard way to do it?
    Thanks,
    Eti

    Dear,
    Please elaborate ur que since its not getting cleared.Regarding serial nos i think u have created serial nos profile and assign it in ur work sch view.What exact req u have regarding std value formula for operation with serial nos.What is this RC operation.
    Regards.

  • How to set static value as output

    Hi all,
    It seems like this should be Discoverer 101, but I can't figure out how to do it.
    I'm creating a report that will, in essence, create input for a API interface to load SITs. There are certain columns that will have a static value for all records and others where I just need the column with a null value. Taking a look at the functions, there doesn't seem to be one that will just let me specify the value.
    Can someone help? It seems like this should be easy.
    Thanks in advance - J

    You should be able to create a calculation like:
    'MyStaticValue'or use the static value you want. Include the calculation in the report, and you are all set.

  • Possible to simulate a spreadsheet for input, with static values per row

    Haven't seen this done but thought I'd ask, is it possible to simulate a spreadsheet interface in Apex? Basically, I have 9 columns each of which needs to be filled out for 10 time periods per day (row), and it's easiest for the user to tab across the columns then down to a new row / next timeslot, to fill out the whole day's worth of data, rather than entering hour by hour & then changing the timeslot manually. This would require that the value for column 1 of row 1 = 8, column 1 of row 2 = 9, column 1 of row 3 = 10 and so on. So, a tabular form but with static values on each row.
    Is this possible & if so, any pointers to what to start researching to make this work would be greatly appreciated. I know they can work in a spreadsheet & upoad it and we may go that way but this seemed like an interesting problem to see if Apex could handle it; I just am uncertain where to start on it is all.
    Many thanks for your pointers!
    gp
    Edited by: 834058 on Jul 18, 2011 10:37 AM

    Tabular report, with some modifications to have rows added at start of usage. User would on occasion need to click a control to add rows..
    Thank you,
    Tony Miller
    Webster, TX
    There are two kinds of pedestrians -- the quick and the dead.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Static values of message choice

    hi,
    I want to create a message choice with static values, without VO.
    how can i do this?
    thx

    I want to put in a list values of currency.
    I have create VO DeviseVO with two attribute :
    RowKey : primaryKey,number
    Values : Varchar
    i have tried this code but the numberd displayed is 0
    public void initializeMethod(){
    String values []={"Dinar","Euro","Dollar"};
    DeviseVOImpl pervo=getDeviseVO1();
    if(pervo.getFetchedRowCount()==0)
    for(int i=0;i<3 ;i++)
    pervo.executeQuery();
    Row prow = pervo.createRow();
    pervo.insertRow(prow);
    try
    prow.setAttribute("RowKey",new Number(i));
    prow.setAttribute("Values",values [ i ] );
    pervo.getCurrentRow().validate();
    catch(Exception ex)
    pervo.getCurrentRow().remove();
    pervo.executeQuery();
    System.out.println(pervo.getFetchedRowCount());
    }

Maybe you are looking for

  • Time Out Connection to Database

    Dears,, I am trying to connect to the database through Toad or Sql but it gave me the following error: ORA-12170: TNS:Connect timeout occurred Also, ifd i tried to log in the database UNIX server through Putty ,it gave me the following error Network

  • Bank Account Detials Query

    Good Day, I would like to ask how can I get the Account Usage, Account Type and Foreign Exchange Charges of the Bank Account in a Query. The tables that I have looked for so far is CE_BANK_ACCOUNTS and CE_BANK_BRANCHES_V Thanks,

  • External Harddrive, time machine issue

    alright im sure this is gonna seem sorta confusing but here it goes. right now i have a 160GB hard drive, and 40 GB of stuff on my 250GB external harddrive. all of it is full. and now i was wondering if i could back up the 200 GB of info (160 on hard

  • MCX Does Not Apply to Cross Realm User Accounts

    Here's the situation: Kerberos realm (REALM1) set up for user account access AD created to allow authentication via REALM1 as well as AD (REALM2) Mac OS workstations are bound to AD and local Mac OS Kerberos configurations on the clients allow authen

  • FRM-10142 Forms error need help!

    Hi -- I am getting an error while trying to run a form in Oracle Forms Builder. The error is "FRM-10142 The HTTP listner is not running on (computer Name) at port 8888. Please start the listener or check your runtime preferences." My tnsnames file ha