SELECT FROM (LIST)

Hi all,
11.2.0.1
How do I select a list of constants as a TABLE?
For example:
SELECT ENAME FROM EMP minus SELECT FROM (
'SCOTT',
'EDDIE',
'STEVE'
and more than 50s name
Thanks,
zxy

>How do I select a list of constants as a TABLE?
What exactly you are trying to solve ?
set head off
set pages 1000
set recsep off
set line 200
select 'select ename'||chr(10)||'from emp'||chr(10)||'minus'||chr(10)||'select ename'||chr(10)||'from'||chr(10)||'('||chr(10) from dual
union all
select 'select '||chr(39)||ename||chr(39)|| ' ename from dual'||chr(10)||case when rownum<(select count(*) from emp) then 'union all' else ')' end||chr(10) from emp;
But why to minus when I can say :
select ename from emp where ename not in ('JONES','FORD','WARD');
Regards
Girish Sharma

Similar Messages

  • As Bex Query design why I canu2019t select from list in values range

    Hello experts,
         I want to pop input window when I use analyzer run bw report, I know to add filter through restrict, then I selected value ranges, it was appearing between input text, the button canu2019t let me input, I tried select from list, Bex Query design occured some errors, if click u2018exitu2019 will prompt unknown software exception(0xc00200001) then stop .
    the imange: [http://www.itpub.net/thread-1192217-1-1.html]
    How to input text or select list? Why My Bex query design canu2019t do select from list? 
    please let me know the soultions, thanks for you help in advance
    Regards,
    Steve

    first of all, thanks for your help.   if need to install batch, please let me know. many thanks .
    more infomation as belows:
    the windows prompt:
    Your application an unhandled exception occurs. If you click [continue], the application will ignore the error and try to continue. If you click the [end], it will immediately close the application.
    I clicked more detail button , displayed as belows:
    For more information call using Just-In-Time (JIT) debugging details
    Please refer to the end of this message (instead of this dialog box) information.
    Exception Text **************
    System.NullReferenceException: Object reference not set to be the implementation of individual objects
    in com.sap.bi.et.selector.BExSelectorDialog.SelUIDialog.HandleUnhandledException(Exception iException)
    in com.sap.bi.et.selector.BExSelectorDialog.SelUIDialog.OnGuiUnhandledException(Object iSender, ThreadExceptionEventArgs iEventArgs)
    in System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
    in System.Windows.Forms.Control.WndProcException(Exception e)
    in System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
    in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    in System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
    in System.Windows.Forms.Control.SetVisibleCore(Boolean value)
    in System.Windows.Forms.Form.SetVisibleCore(Boolean value)
    in System.Windows.Forms.Control.set_Visible(Boolean value)
    in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    in System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
    in System.Windows.Forms.Form.ShowDialog()
    in com.sap.bi.et.selector.BExSelectorDialog.SelUIDialog.GetUserSelection()
    in com.sap.bi.et.selector.BExSelectorDialog.SelUIDialog.ShowSelector()
    in com.sap.bi.et.selector.BExSelectorDialog.SelUICtrlDDBox.InvokeSelector()
    in com.sap.bi.et.selector.BExSelectorDialog.SelUICtrlDDBox.OnInvokeSelector()
    in com.sap.bi.et.selector.BExSelectorDialog.SelUICtrlDDBox.picValueHelp_Click(Object sender, EventArgs e)
    in System.Windows.Forms.Control.OnClick(EventArgs e)
    in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    in System.Windows.Forms.Control.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    inSystem.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • How to select from list of values?

    Dear All,
    I am using XML publisher for word, where I need to select a value from a list of values, for example I have hotel code like TTAG,TOBBR,TTAG,TOTM now I need
    to select hotel code and the corrosponding data should be display on word after
    running the RTF. Tell me, how can I achive the same?
    hare krishna
    Alok

    Thanks prety much,I am using XML to upload data from there into RTF templete. I've already insert table through load data option, but my problem is, how could I select a value from a list of values and based on that value selected from the list, it should displaydata corrosping to it. For example, I have few codes like TTAG, AMAG, TOTOM and if I select TOTM, it should display the complete address of that hotel named TOTM. If above given scenario is not at all possible, then Is there any alternate method to achieve this?
    hare krishna
    Alok

  • F4IF_INT_TABLE_VALUE_REQUEST - what line was selected from list displayed

    I am building an internal table and displaying it as search help using F4IF_INT_TABLE_VALUE_REQUEST.  How can I tell what line was selected from the search help?  Only one field is filled with the selection, but there are several other fields attached to this that I need in my program - but I can't tell which line was selected, and the one field is not enough information to use to get the record from the internal table.

    Hi,
    RETURN_TAB would have the selected values.
    FIELD_TAB will have the hit list fields.
    DYNPFLD_MAPPING will have the Assignment of the screen fields to the internal table.
    Regards,

  • Selecting from list - Urgent

    I need to select a CODE from available list of codes from table2 and insert the selected code into table1 but before I do the insertion, I need to make sure that unique constraint is satisfied.
    In other words,no 2 same codes should be selected from the list for 2 rows.
    example, if row1 is 24
    no other rows within this select should be 24
    Any ideas on how to implement?
    Thanks in advance

    Here's what I suggest.
    1) On the when-new-record-instance of the table1 block you should use a post, which will do the needed insert/update/delete processing, but not the commit.
    2) The record-group for fetching the values in the LOV should be something like:
    select code, name
    from table 2
    where code not in (select code from table 1)
    Note:
    The post is intended in order that the record group should also "notice" the last record inserted/updated/deleted in/from table1.
    As I recall, you may have some problems with the post in the when-new-record-instance trigger on the table1 data block if that data block in case that data block contains no records, case that will need a special treatment.

  • Unable to Select from List of Processes

    Hi all.
    I'm having an issue where I am unable to mouse click (or select) from a list of processes. This is happening in three different areas. When I click Start Processes, I am able to select an employee (even from HR Admin I can enter an employee) without any problems. Then after choosing my employee, I click the button 'Select Process' and I get a list of P&Fs processes. However, the top process is pre-selected and I am unable to select any other process. Even though the list of processes are different for HR Admin and manager, I still can only proceed to the Adobe form with the first (top) process. If I click edit to continue to the adobe form it opens the top selected form without an issues.
    This also happens from the "Find Processes" overview screen. After entering my select criteria of processes to search, I get a list of process transactions which have been started but again, I am only able to see the details of the first one (and I cannot select any other process).
    I am running Ehp 3 with the latest patches to BPs and ECC 6.0 (as of 1/3/2010). I've also tried using different browsers including IE 8 and Google Chrome.
    Much appreciated in advance!
    Derrick

    Hi Chris.
    Not sure what to look for when you reference 'controls'. As far as the business packages, they are up to date. I've eliminated the issue being ECC 6 related. Just not sure what to check on the portal side that could be causing this. Any suggestions on how to check (and update if necessary) the controls?
    Thanks,
    Derrick

  • Keyboard shortcut to open a cells pop-up menu and select from list of options.

    I guessed Option-Return would be the shortcut from this, as it typically lets you edit a cells contents, but no. Read the keyboard Shortcuts list in Numbers>Help but didn't see anything.

    Hi ts,
    Thanks for drawing my attention to this! Let's add some missing detail…
    While "you just press spacebar" to open the pop-up menu, that won't select a menu item.
    After you've opened the menu, 'you could press the first letter' of an entry, ( 'like every other pop-up list on Earth,') or you could press the down arrow to step down the list (and the up arrow to step up, if you went beyond the item you wanted to choose).
    And you can change your mind; the menu will stay open until you confirm your choice (by pressing the space bar again, OR by pressing return OR by pressing enter).
    Note that pressing the first letter will select the 'smallest' item name beginning with that letter. To move to another item name starting with that letter, you'll need to use the up or down arrow key (or the mouse).
    Thanks again for posting. With luck, WideEyedPupil will still be monitoring this discussion, and will see these posts.
    Regards,
    Barry

  • Trigger should fire on Mouse Selection from List

    Hi,
    I have two list item type boxes in which first one is populated on when-new-block-instance trigger I want to populate second on the basis of first list item selection which trigger should I use b/c I already tried mouse-click but it fires on just clicking on list box not provide the selection of individual item and also mouse double click and mouse enter both are suffice the requeirement.
    One thing more I have defined key-next-item trigger on the above first list item but once I click on this list item the key-next-item trigger will be disabled automatically or not fired.
    Thanks and regards
    Message was edited by:
    skhawar03

    Hi,
    When-mouse-click as I understand you can't use in case of poplist b/c if you click on poplist this trigger will fire and does not allow you to do anything, regarding when-mouse-enter this trigger doesn't work I have used this trigger but how it fires I don't understand, if anyone know tell me, thanks.

  • Value of a cell dependent on a data selected from the list in another cell

    Hello Everyone,
    Could you please help to solve this puzzle.
    I need to make a value of cells in the 2nd column dependent on the selection made in the cells in the 1st column, i.e.:
    Header 1
    Header 2
    List An
    LIst Bn
    Lists A and B have 10 items each
    A1    B1
    A2    B2
    A10  B10
    If A1 is selected I need a B1 appear in the second column in the same row, if A2 selected then B2,...and so on.
    Could you please hep to resolve this, if at all this is possible?
    Many thanks,
    Andrew

    Supposing that your list is a drop down list, you could put a script like the following on the exit event of List A. (very approximate, since I don't know any of your field names)
    switch (this.rawValue)
    case "A1":
         ListB.rawValue = "B1";
         break;
    case "A2":
         ListB.rawValue = "B2";
         break;
    Obviously, you'll want to replace "ListB" with the name of your field, and possibly the references to it (ie. TableName.RowName.FieldName) and fill in more case statements all the way to A10 if that's what you need. If List B is going to be a read-only field, you may even want to make it simply a text input box and have it display the values you want it to have based on the selection from List A.

  • When using Mail and selecting the recipient, Address Book no longer shows Groups. I am forced to select from my entire alphabetized contact list. What's going on?

    Has the Address Book software changed? Or has Mail changed? For purposes of email, Address Book no longer allows me to find an addressee or several addressees who are members of one of my Groups (or Smart Groups). What happens is this: I open Mail, initiate a new email, put the cursor in the To: box and click the 'Show addresses' icon in the New Message box. The Addresses list shows up in a separate window with an alphabetized listing of all my contacts. It used to allow me to select a Group, but Groups are no longer listed. I have no choice but to select an address (or addresses) from the entire list. Needless to say, this is intolerable.
    Ultimately, I have two questions:
    What has changed and can I fix it so it works as it used to?
    If I can't fix it, what other email/address book software combination works simply and cleanly so I don't have to live with this frustration.

    This add-on may help:
    https://nic-nac-project.org/~kaosmos/morecols-en.html
    I've had this add-on for so long that I can't remember what it does and does not provide.
    If you select a List in your Address Book, so that its contents display at the right, does "Export" not write just the Lists's member Contacts out to the csv file?
    It does here, but this may be thanks to the above-mentioned add-on.

  • How can I select from drop-down list and jumping to selected subform?

    I using LC Designer ES2 vers 9. Developing XDP. How can I Select from a drop-down list the appropriate selected subform (jumping to the selected subform on the page)?
    drop-down list...A (jump to subform1)
                             B (jump to subform2)
                             C (jump to subform3)
    subform1
    subform2
    subform3
    ....end of form

    Hi,
    you cannot set focus on a subform but on a field, as only interactive objects can be focussed.
    From a dropdowns exit event the script will look this way:
    switch (this.rawValue) {
              case "A" : xfa.host.setFocus("form1.page2.field1"); break;
              case "B" : xfa.host.setFocus("form1.page2.field1"); break;

  • Selecting from a list to a table

    need help.i have items in a list and combo box in which i want it in such away that when item is selected from the list and combo box it goes to the table i have in a panel.i want to discard the text area i used.thanks in advance
    my code:
    '\n'
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    public class BreakFast extends JFrame implements ActionListener{
         private JList ingredient;
         private JTextArea meal;
         private JTable table;
         private DefaultTableModel model;
         private JButton move;
         private String[] food;
         private JComboBox box,box1;
         private String[] units;
         private double[] price={100,150,200,250,300,350,400};
         public BreakFast(){
              Container c=getContentPane();
              c.setLayout(new FlowLayout());
              food = new String[] {"Corn Flakes","Beans","Shredded Bread","Mushroom",
              "eggs","Milks","Butter","Sugar","water","Oil"};
              ingredient = new JList(food);
              ingredient.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
              ingredient.setVisibleRowCount(4);
              JPanel p = new JPanel();
              p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
              //move = new JButton(">>>");
              //move.addActionListener(this);
              meal = new JTextArea(5,20);
              meal.setEditable(false);
              p.add(new JScrollPane(ingredient),"Wast");
              //p.add(move,"Center");
              p.add(new JScrollPane(meal),"East");
              JPanel p2 = new JPanel();
              p2.setBorder(new BevelBorder(BevelBorder.RAISED));
              units = new String[]{"2 cups","3 cups","4 cups","5 cups","1 mudu","2 mudu",
                        "3 mudu","4 mudu","5 mudu","6 mudu","7 mudu","8 mudu","9 mudu",
                        "1 bag"};
              box = new JComboBox(units);
              box.addActionListener(this);
              box1 = new JComboBox();
              //box1.setEditable(true);
              box1.addActionListener(this);
              for(int i=0;i<price.length;i++){
                   box1.addItem(price);
              model = new DefaultTableModel();
              model.addColumn("No.");
              model.addColumn("Food Items");
              model.addColumn("Units");
              model.addColumn("Price");
              String[] cell={"1","Rice","2 cups","#20"};
              model.addRow(cell);
              table = new JTable(model);
              JScrollPane pane = new JScrollPane(table);
              pane.setPreferredSize(new Dimension(200,100));
              p2.add(box,"North");
              p2.add(box1,"South");
              p2.add(pane,"East");
              c.add(p);
              c.add(p2);
              setSize(450,300);
              setVisible(true);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void actionPerformed(ActionEvent e){
                   Object[] value = ingredient.getSelectedValues();
                   if(e.getSource() instanceof JComboBox){
                        for(int i=0;i<value.length;i++){
                             String word = (String)value[i];
                             meal.append(box.getSelectedItem()+" "+"of"+" "+word+" "+box1.getSelectedItem()+"\n");
         public static void main(String[] arg){
              new BreakFast();

    So the problem is?
    All you need to do is to create the JTable first of all (which you haven't done). Secondly, you create a TableModel for it so can manage its data effectively.
    Thirdly, you replace the code in your actionPerformed method to add a new row containing the data you received from the list and combo box.
    Now is that so hard? Okay, here is some code
    DefaultTableModel model = new DefaultTableModel(0,3);
    JTable table = new JTable(model);
    public void actionPerformed(ActionEvent e){
        Object[] value = ingredient.getSelectedValues();
        if(e.getSource() instanceof JComboBox){
            for(int i=0;i < value.length;i++){
                String word = (String)value;
    Vector<Object> data = new Vector<Object>();
    data.addElement( box.getSelectedItem() );
    data.addElement( "of" + " " + word );
    data.addElement( box1.getSelectedItem());
    model.addRow( data );
    ICE

  • How do I do SELECT * FROM TABLE WHERE KEY IN ({list})?

    The title says it all really.
    Is there a reasonable performant way to perform the query
    SELECT * FROM TABLE WHERE KEY IN ({list})where {list} is String []?
    I am currently creating a PreparedStatement with a for loop like this   StringBuffer sb = new StringBuffer ("SELECT * FROM TABLE WHERE ID IN (");
      for (int ii=0;ii<keys.length;ii++) {
        sb.append (keys [ii]);
        if (ii != keys.length-1) sb.append (",");
      sb.append (")");but this means that the prepared statement is created each time I call my method and so I'm not sure that the optimizer will find it easy to cope with. Is there a construction that I'm missing along the lines of SELECT * FROM TABLE WHERE KEY = ? where I can create the PreparedStatement once and just call setObject or something on it when the values in {list} change?

    but this means that the prepared statement is created
    each time I call my method and so I'm not sure that
    the optimizer will find it easy to cope with.You are right, the optimizer won't find that easy to deal with (presuming that is even relevant for your driver/database.) But most optimizers won't do anything with statements that change and that is what you are doing.
    You could create several prepared statements which have a common number of bind variables. For example 10 statements with from 1 to 10 bind values. This will work if most of the queries use those.

  • How to go to a certain page based on user's selection from a select list

    On the very first page of my application, I have one item - a select list. Based on what they select from the list, how do I go to the corresponding page? For instance, if the user selects 'Metal', how do I go to the Metal page?

    Hello,
    Assuming the answer to Sergio is "yes" …
    First, you should make sure that the returned value from your select list is the corresponding page number or page alias for the user selection. Using your terms – "Metal" should return the page number/alias of the page where you want to implement "Metal".
    Then, on your first page, you can define a "Branch to Page Identify by Item". The parameter should be your select item name.
    Regards,
    Arie.

  • Forcing a user to only select from Parameter LOV list

    Hi,
    I suspect that the answer is no but I'd appreciate clarification on the matter. I am wondering if there is any way to prevent a user entering a value into a parameter field - I want them to only select from the parameter's drop down LOV list. This will apply to Discoverer Viewer but would like to know if it could be done for Plus ( or not ) as well,
    Kevin.

    Hi Kevin
    Try changing the item class property called Require user to always search for values.
    According to my notes: This is unchecked by default. If you check this, Discoverer will launch the Search dialog box whenever a user clicks on the list of values. Should you have a large list of values, you may want to consider turning on this optionto making the LOV box pop up automatically.
    I am not convinced this will make the pop-up come up but it's worth a try.
    I'd be interested in hearing how you get on.
    Best wishes
    Michael

Maybe you are looking for