Need help returning only 1min

I'm working on a custom Discrete Job Picklist and am trying to return the locator with the least amount of the item that is required to pick. This is working fine except when the minimum is not distinct.
Here's the bit of code that I'm working with:
and d.total_qoh = (select min(f.total_qoh)
from apps.mtl_onhand_locator_v f
where d.item = f.item)
This returns the mins but give me duplicates when the mins are the same. I'd like to return only 1 min locator per item. I've tried using a select distinct, but this does not work.
Ideally, I'd like to use the min(locator_id) to determine which locator to use should the min(total_qoh) be non-distinct.
I've tried using:
and d.total_qoh = (select *(select min(f.total_qoh)
from apps.mtl_onhand_locator_v f
where d.item = f.item
order by d.locator_id)
where rownum = 1)
But I don't think that order by is allowed in 8.1.6.1 and so it is not working. Likewise, I can't seem to get TOP N to work.
Any suggestions?
-Tracy
Here's the full sql:
select b.wip_entity_name "Job #",
       d.padded_concatenated_segments "Item",
       d.item_description "Description",
       c.REQUIRED_QUANTITY "Qty",
       e.segment1 "Row",e.segment2 "Section", e.segment3 "Shelf", e.segment4 "Bin",
       d.total_qoh "Qty at Loc",
       d.locator_id
from wip.wip_discrete_jobs a, wip.wip_entities b, wip.wip_requirement_operations c, apps.mtl_onhand_locator_v d,  inv.mtl_item_locations e
where a.wip_entity_id = b.wip_entity_id
and   a.wip_entity_id = c.wip_entity_id
and   c.inventory_item_id =  d.inventory_item_id
and   d.locator_id = e.inventory_location_id
and   d.ORGANIZATION_ID = '5'
and   b.wip_entity_name >= '70319'--:job_low
and   b.wip_entity_name <= '70320'--:job_high
and   e.segment1 is not null
and   a.status_type in  ('3', '1') --released and unreleased jobs
and   d.total_qoh = (select min(f.total_qoh)
                    from apps.mtl_onhand_locator_v f
                    where d.padded_concatenated_segments = f.padded_concatenated_segments)
order by b.wip_entity_name, e.segment1, e.segment2, e.segment3, e.segment4; Thanks for any help you can offer.
-Tracy

Richard - this is yielding ora-00904: invalid column. Although I have verified that the column names are correct. I think this may have something to do with not allowing an order by in a subquery for 8.1.6.1 but am not positive. It seems that I either get an invalid column name or missing right parenthesis when using order by in the subquery.
and d.locator_id = (select locator_id
                       from (select locator_id
                                from apps.mtl_onhand_locator_v
                                where d.padded_concatenated_segments = f.padded_concatenated_segments
                                order by total_qoh desc, locator_id desc)
                       where rownum = 1)
-Tracy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Need help returning correct name from a code created movie clip

    Hello. I am an AS3 n00b with hopefuly a simple question I am designing a simple game in flash. This code creates an array of movie clips and asigns a picture to each one. It is a map screen. What I need is when I click on one of the created movie clips, I need it to return either the index of the clip in the array or the name of the clip. Basicaly anything I can use to tell them apart in the code. Here is the code:
    import flash.display.MovieClip;
    var MapLoader:Array = new Array();
    var strJPGext:String = ".jpg";
    var intContTileNumber:int;
    var strContTilePath:String;
    var intDistStartX:int = 63;
    var intDistStartY:int = 64;
    var intDistMultiplyY:int = 0;
    var intDistMultiplyX:int = 0;
    var intDistCount:int = 0;
    var MapSquare:Array = new Array();
    for (var i:int = 0; i < 729; i++)
             //var MapSquare:MovieClip = new MovieClip();
            MapSquare.push (new MovieClip());
            MapSquare[i].x = intDistStartX + (intDistMultiplyX * 30);
            MapSquare[i].y = intDistStartY + (intDistMultiplyY * 30);
            MapSquare[i].name = "MapSquare" + i ;
            addChild(MapSquare[i]);
            intContTileNumber = i;
            MapLoader.push (new Loader);
            strContTilePath = intContTileNumber + strJPGext;
            MapLoader[i].load(new URLRequest(strContTilePath));
            MapSquare[i].addChild(MapLoader[i]);
            intDistCount++;
            intDistMultiplyX++;
            if (intDistCount > 26){
            intDistCount = 0;
            intDistMultiplyX = 0;
            intDistMultiplyY++;
    stage.addEventListener(MouseEvent.CLICK, reportClick);
    function reportClick(event:MouseEvent):void
        trace("movieClip Instance Name = " + event.target.name);   
    Now all this works fine, it creates the map and assigns the correct picture and places them in the correct X,Y position and it is the correct grid of 27x27 squares. The problem is with the name, when I click on the movie clip, it returns "Instance2" or "Instance5" or whatever. It starts with 2 and then increases each number by 3 for each clip, so the first one is 2, then 5 then 8 and so on. This is no good. I need it to return the name that I assigned it
    . If I put the code in trace(MapSquare[1]) it will return the name "MapSquare1" so I know the name was assigned, but it isnt returning.
    Please assist
    Thanks,
    -red

    Thanks for the resopnse,
    I know I dont really need the name, I just need the index number of the array, but I cant figure out how to get the index name without specificaly coding for it. That is why in the listener event I use event.target.name because I dont know what movie clip is being clicked until it has been clicked on. Basically when a movie clip is clicked it needs to return which index of the array was clicked.
    I could do it this way:
    MapSquare[0].addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
        trace("I've been clicked!");
    MapSquare[1].addEventListener(
       MouseEvent.MOUSE_UP,
       function(evt:MouseEvent):void {
         trace("I've been clicked!");
    MapSquare[2].addEventListener(
       MouseEvent.MOUSE_UP,
       function(evt:MouseEvent):void {
         trace("I've been clicked!");
    ... ect
    but that is unreasonable and it kind of defeats the purpose of having the array in the first place. The code that each movie clip executes is the same, eventualy that index will be passed into a database and the data at that primary key will be retrieved and returned to the program. So I just need to know, when one of those buttons is clicked, which one was clicked and what is its index in the array.
    I am a VB programer and in VB this is very easy, the control array automatically sends its own index into the function when one of the buttons is clicked. It seems simple enough, I just dont know how to do it in action script.
    Thanks again,
    -red

  • Need help returning (not printing) avg GPA from array??

    Here's what I have so far. After returning the value then I gotta print the avg in a separate method. I also need to check the names of the first and last student using an "equals" method. Please someone help with whatever you can. Here's what I got:
    import java.util.Scanner;
    public class StudentLists {
    //Main method. Prompts user for the number of students.
       public static void main(String[] args) {
       Scanner in = new Scanner(System.in);
       System.out.print("Please enter the number of students in this class: ");
       int s = in.nextInt();
       Student[] students=new Student[s];
       FillStudents(s,students);
       printAll(students);
       public static void FillStudents(int s, Student[] students){
       for (int i=0; i<s; i++)
            Scanner inf = new Scanner(System.in);
            System.out.println("Please enter student's first name: ");
        String first = inf.nextLine();
        System.out.println("Please enter student's last name: ");
            String last=inf.nextLine();
            System.out.println("Please enter the number of credits completed: ");
            int c=inf.nextInt();
            System.out.println("Please enter student's GPA: ");
            Double g=inf.nextDouble();
            students[i] = new Student(first, last, c, g);
        public static void printAll(Student[] students) {
        System.out.println("Names      Credits  GPA");
           for(int i = 0; i < students.length; i++)
        System.out.println(students);
    public static Double getAvg(Student[] students, Double g){
    double sum=0.0;
    double avg=0.0;
    for(int i=0; i<students.length; i++){
    sum+=g;
    avg=sum/students.length;
    return avg;

    Oh no I wasn't giving any orders. I was saying I have been trying to edit what I have, but I can't figure out how to get the method right to do my average of the GPA from the loop. I don't know what to put in there. I was just asking if you would write it and then kind of explain what u did for me please.
    import java.util.Scanner;
    public class StudentLists {
    //Main method. Prompts user for the number of students.
       public static void main(String[] args) {
       Scanner in = new Scanner(System.in);
       System.out.print("Please enter the number of students in this class: ");
       int s = in.nextInt();
       Student[] students=new Student[s];
       FillStudents(s,students);
       printAll(students);
       public static void FillStudents(int s, Student[] students){
       for (int i=0; i<s; i++)
            Scanner inf = new Scanner(System.in);
            System.out.println("Please enter student's first name: ");
        String first = inf.nextLine();
        System.out.println("Please enter student's last name: ");
            String last=inf.nextLine();
            System.out.println("Please enter the number of credits completed: ");
            int c=inf.nextInt();
            System.out.println("Please enter student's GPA: ");
            Double g=inf.nextDouble();
            students[i] = new Student(first, last, c, g);
        public static void printAll(Student[] students) {
        System.out.println("Names      Credits  GPA");
           for(int i = 0; i < students.length; i++)
        System.out.println(students);
    public static Double getAvg(Student[] students){
    double sum=0.0;
    double avg=0.0;
    for(int i=0; i<students.length; i++){
    avg=sum/students.length;
    System.out.println(avg);
    return avg;

  • Need help returning processor task list.

    I'm new to KEXT/Kernel programming and Xcode, so I'm sure these are fairly beginner questions, but I'm having some trouble.  I'm trying to return a list of processor tasks, so I can test different things such as process id's, file descriptors, etc.
    I'm not sure what functions would be useful for me.  Is there some way that I would be able to return a list of all running processor tasks and/or their information?  Would someone be able to point me in the right direction?

    Yeah, usually it helps me out quite a bit, but I've been googling for over a week, and I get a whole lot of nothing.  Everything that I've actually been able to find uses outdated headers and functions that don't exist anymore.  Maybe my google skills just aren't very good for this area, since I *am* new to this after all...
    I figured it would be much more time-efficient to just ask the dev community.  Any insight would be appreciated.

  • Need to return only one record from select statement.

    Hello friends,
    I have a scenerio in which code only want to fetch one value from the SQL statement, but in some cases the statment return more then one row due to which ORA-01422 : Exact fetch return more then one row, error comes.
    Can you suggest me to write a select statement that will handel this. I am using the below mentioned select statement:
    EXECUTE IMMEDIATE
    'SELECT rsdn FROM ' || schema || '.table_name' ||
    ' WHERE a = :1 AND b = :2 AND c IN (32,33,34)'
    INTO v_rsdn USING v_a, v_b;
    One question, Can I use Rownum < 2 in Where clause to restrict the select output to only one record ? Please suggest ?
    Regards,
    Rajat

    Well, if rownum=1 could be a trash answer, it would be an issue since we don't know which record you are interested to. Is it one particular ? Is it only to workaround the issue ? Then you may want to manage some BULK COLLECT or whatever else array to receive all the rows as well.
    What are you doing with the rows returned ?
    Nicolas.

  • Need help returning an Int!!!

    here is the code for my sport quiz class:
    import javax.swing.*;
    public class Sport
         public static int main (String []args)
    Object[] sportValues = { "Freddie", "jimbo", "the destroyer" };
    Object sportq1;
    Object[] sportValues2 = { "David Beckham", "Alessandro Del Piero",
    "Michael Ballack" };
    Object sportq2;
    Object[] sportValues3 = { "6", "10", "14" };
    Object sportq3;
    int sportScore = 0;
    String message;
    //............QUESTION 1..............
    sportq1 = JOptionPane.showInputDialog(null, "Question 1: What nickname is given to england cricketer andrew flintoff?", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
    sportValues, sportValues[0]);
    if (sportq1.equals(sportValues[0]))
    message = "CORRECT!";
    JOptionPane.showMessageDialog(null, message);
    sportScore = (sportScore+1);
         else
         message = "WRONG!";
         JOptionPane.showMessageDialog(null, message);
         //............QUESTION 2.............
    sportq2 = JOptionPane.showInputDialog(null, "Question 2: Who scored italy's second goal in the world cup final?", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
    sportValues2, sportValues2[0]);
    if (sportq2.equals(sportValues2[1]))
    message = "CORRECT!";
    JOptionPane.showMessageDialog(null, message);
    sportScore = (sportScore+1);
         else
         message = "WRONG!";
         JOptionPane.showMessageDialog(null, message);
         //............QUESTION 3.............
    sportq3 = JOptionPane.showInputDialog(null, "Question 3: how many players are there in an ice hockey team?", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
    sportValues3, sportValues3[0]);
    if (sportq3.equals(sportValues3[0]))
    message = "CORRECT!";
    JOptionPane.showMessageDialog(null, message);
    sportScore = (sportScore+1);
         else
         message = "WRONG!";
         JOptionPane.showMessageDialog(null, message);
         return sportScore;
    i am trying to return the 'sportScore' int to a main quiz class but for some reason it hasnt worked...
    can anyone tell me what i have done wrong?
    thanks alot!

    this is my main quiz class:
    import javax.swing.*;
    public class Quiz
         public static void main (String []args)
             Object[] possibleValues = { "Sport", "Music", "General Knowledge", "TV and Film", "Display Score Board" };
             Object choice;
             do
          choice = JOptionPane.showInputDialog(null,"Welcome to my quiz\nPlease select you category:", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
          possibleValues, possibleValues[0]);
          if  (choice.equals(JOptionPane.CANCEL_OPTION))
        System.exit(0);
        if (choice.equals(possibleValues[0]))
            Sport.doQuiz();
         if (choice.equals(possibleValues[1]))
            Music.doQuiz();
         if (choice.equals(possibleValues[2]))
            General.doQuiz();
        if (choice.equals(possibleValues[3]))
            TV.doQuiz();
        if (choice.equals(possibleValues[4]))
            int sportScore = Sport.doQuiz();
            int tvScore = TV.doQuiz();
            int musicScore = Music.doQuiz();
            int generalScore = General.doQuiz();
            int totalScore = (sportScore+tvScore+musicScore+generalScore);
            JOptionPane.showMessageDialog(null,"Thankyou for taking my quiz!\nhere are your results:\nSport: "
            + sportScore + "/3\nMusic: " + musicScore + "/3\nGeneral Knowledge: "
            + generalScore + "/3\nTV and Film: " + tvScore +"/3\n\nTOTAL: "
            + totalScore + "/12!");
        while(!(choice.equals(possibleValues[4])));
        }as you can see i have more than just the sport category but once i know how to do that one i will be able to do the rest...
    now here is my sport class:
    import javax.swing.*;
    public class Sport
           public static int doQuiz()
              Object[] sportValues = { "Freddie", "jimbo", "the destroyer" };
                Object sportq1;
              Object[] sportValues2 = { "David Beckham", "Alessandro Del Piero",
    "Michael Ballack" };
                Object sportq2;
              Object[] sportValues3 = { "6", "10", "14" };
                Object sportq3;
                int sportScore = 0;
                String message;
         //............QUESTION 1..............
                sportq1 = JOptionPane.showInputDialog(null, "Question 1: What nickname is given to england cricketer andrew flintoff?", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
                sportValues, sportValues[0]);
                if (sportq1.equals(sportValues[0]))
                  message = "CORRECT!";
            JOptionPane.showMessageDialog(null, message);
            sportScore = (sportScore+1);
             else
                 message = "WRONG!";
              JOptionPane.showMessageDialog(null, message);
             //............QUESTION 2.............
                sportq2 = JOptionPane.showInputDialog(null, "Question 2: Who scored italy's second goal in the world cup final?", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
                sportValues2, sportValues2[0]);
                if (sportq2.equals(sportValues2[1]))
                  message = "CORRECT!";
            JOptionPane.showMessageDialog(null, message);
              sportScore = (sportScore+1);
             else
             message = "WRONG!";
             JOptionPane.showMessageDialog(null, message);
             //............QUESTION 3.............
                sportq3 = JOptionPane.showInputDialog(null, "Question 3: how many players are there in an ice hockey team?", "selection", JOptionPane.YES_NO_CANCEL_OPTION, null,
                sportValues3, sportValues3[0]);
                if (sportq3.equals(sportValues3[0]))
                  message = "CORRECT!";
            JOptionPane.showMessageDialog(null, message);
              sportScore = (sportScore+1);
             else
                 message = "WRONG!";
              JOptionPane.showMessageDialog(null, message);
             return sportScore;
    }i am tring to return sportScore from the sport class to the main quiz class, at the moment instead of getting the sportScore at the end of the quiz class it is now running the whole sport class again!
    what have i done wrong?
    ta

  • Need help returning largest of three numbers....

    Hello,
    I'm stuck in an essential part of a program. The objective of the program is suppose to call a static method that will find and return the largest of three numbers. Im suppose to test the program with the following three sets of three numbers: (2, 5, 8), (2, 10, 5), (67, 23, 17).
    After lots of thinking, I decided to write a program that will do exactly what the objective requires, but without calling a static method that will find and return. I tried calling a static method but it's real confusing and I couldnt do it right.
    Below is my program, the top part is right I think, but calling a static method and returning the value is the part Im having trouble in.
    // The "LargeNum3" class.
    import java.awt.*;
    import hsa.Console;
    public class LargeNum3
        static Console c;           // The output console
        public static void main (String [] args)
            c = new Console ();
            int num [] = new int [3];
            int largest;
            largest = num [0];
            for (int i = 0 ; i < 3 ; i++)
                c.println ("Please enter in 3 values");
                for (int a = 0 ; a < 3 ; a++)
                    num [a] = c.readInt ();
                for (int b = 0 ; b < num.length ; b++)
                    if (num > largest)
    largest = num [b];
    c.println ();
    c.println ("The largest number is " + largest);
    c.println ();
    } // LargeNum3 class

    // The "LargeNum3" class.
    import java.awt.*;
    import hsa.Console;
    public class LargeNum3
        static Console c;           // The output console
        // Declare a new static method to return the
        // largest number in the array passed to it
        public static int findLargest(int[] nums)
            int j, largest=nums[0];
            for (j=1; j<nums.length; j++)
                if (nums[j]>largest) largest=nums[j];
            return largest;
        public static void main (String [] args)
            c = new Console ();
            int num [] = new int [3];
            // int largest;
            // largest = num [0]; It was wrong to put this here in
            // in the first place
            for (int i = 0 ; i < 3 ; i++)
                c.println ("Please enter in 3 values");
                for (int a = 0 ; a < 3 ; a++)
                    num [a] = c.readInt ();
                c.println ();
                c.println ("The largest number is " + findLargest(num));
                c.println ();
    } // LargeNum3 class

  • Need help returning to default application icons

    ok, i began to change the icons on my iBook tonight and then decided i wanted the original ones back, when to my dismay i realized i didnt know where to look.
    Where are they?

    irishexpatriate, they are still there. "Get Info" (command-i) on the file you want to change back, then choose the small icon window and delete.
    -mj
    [email protected]

  • Need help with representing 2 bits of data in a column

    I Need help representing only 2 bits of data in a column in order to save space.
    Is that possible?

    CommitMan wrote:
    I Need help representing only 2 bits of data in a column in order to save space.
    Is that possible?Yes - using Assembler....
    If you need to count bits to save space, then you must be on 70's, or early 80's, hardware. So using Assembler should not be a problem. Let me guess.. a 8051 microcontroller from the 1980?
    Here's what the 8051 code and memory optimisation manual says:
    >
    The simplest and best way to get dramatic improvements
    in efficiency is to look for all variables that will have only
    binary values (0 and not 0), and define them as type 'bit‘:
    bit myVar;With bit variables, the full set of 8051 bit-level assembler
    instructions can be used to generate very fast and
    compact code. For example, the following C code:
    myVar = ~myVar;
    if (!myVar)
    }Generates only two lines of assembler:
    B200    CPL myVar
    200006  JB myvar,?C0002This example uses only 5 flash bytes and 8 CPU cycles.
    When you use bit variables, you can implement a
    nontrivial line of C code with just one assembler
    instruction.
    >
    <i>PS. Yes, the above is really from a manual for a real 80s microcontroller. And yes, I'm poking fun at your question as saving bits were a problem in the 80s and prior. It should not be a problem in the 21st century information system and database.</i>

  • Need help with AnyConnect 2.5.3055

    When I try to connect via the AnyConnect client I am presented with the certificate pop up.
    If I accept the certificate I get a message at the bottom of the AnyConnect screen stating “Connection attempt has failed”.
    If I deny it I get a pop up message from AnyConnect stating “AnyConnect cannot confirm it is connected to your secure gateway. The local network may not be trustworthy. Please try another network”.
    I am connecting to a Cisco 2851 running Cisco IOS Software, 2800 Software (C2800NM-ADVSECURITYK9-M), Version 12.4(24)T2, RELEASE SOFTWARE (fc2)

    CommitMan wrote:
    I Need help representing only 2 bits of data in a column in order to save space.
    Is that possible?Yes - using Assembler....
    If you need to count bits to save space, then you must be on 70's, or early 80's, hardware. So using Assembler should not be a problem. Let me guess.. a 8051 microcontroller from the 1980?
    Here's what the 8051 code and memory optimisation manual says:
    >
    The simplest and best way to get dramatic improvements
    in efficiency is to look for all variables that will have only
    binary values (0 and not 0), and define them as type 'bit‘:
    bit myVar;With bit variables, the full set of 8051 bit-level assembler
    instructions can be used to generate very fast and
    compact code. For example, the following C code:
    myVar = ~myVar;
    if (!myVar)
    }Generates only two lines of assembler:
    B200    CPL myVar
    200006  JB myvar,?C0002This example uses only 5 flash bytes and 8 CPU cycles.
    When you use bit variables, you can implement a
    nontrivial line of C code with just one assembler
    instruction.
    >
    <i>PS. Yes, the above is really from a manual for a real 80s microcontroller. And yes, I'm poking fun at your question as saving bits were a problem in the 80s and prior. It should not be a problem in the 21st century information system and database.</i>

  • Need help writing a MySQL query that will return only records with matching counter-parts

    Since I don't know how to explain this easily, I'm using the
    table below as an example.
    I want to create a MySQL query that will return only records
    that have matching counter-parts where 'col1' = 'ABC'.
    Notice the 'ABC / GHI' record does not have a
    counter-matching 'GHI / ABC' record. This record should not be
    returned because there is no matching counter-part. With this
    table, the 'ABC / GHI' record should be the only one returned in
    the query.
    How can I create a query that will do this?
    id | col1 | col2
    1 | ABC | DEF
    2 | DEF | ABC
    3 | ABC | GHI
    4 | DEF | GHI
    5 | GHI | DEF
    *Please let me know if you have no idea what I'm trying to
    explain.

    AngryCloud wrote:
    > Since I don't know how to explain this easily, I'm using
    the table below as an
    > example.
    >
    > I want to create a MySQL query that will return only
    records that have
    > matching counter-parts where 'col1' = 'ABC'.
    >
    > Notice the 'ABC / GHI' record does not have a
    counter-matching 'GHI / ABC'
    > record. This record should not be returned because there
    is no matching
    > counter-part. With this table, the 'ABC / GHI' record
    should be the only one
    > returned in the query.
    >
    > How can I create a query that will do this?
    >
    >
    > id | col1 | col2
    > --------------------
    > 1 | ABC | DEF
    > 2 | DEF | ABC
    > 3 | ABC | GHI
    > 4 | DEF | GHI
    > 5 | GHI | DEF
    >
    >
    > *Please let me know if you have no idea what I'm trying
    to explain.
    >
    Please be more clear. You say that 'ABC / GHI' should not be
    returned,
    and then you say that 'ABC / GHI' should be the only one
    returned. Can't
    have both...

  • Need help on returning input

    Hi. I'm making a DateTimePicker (DTP), and I need help on getting a method to return a Date only when the DTP is closed, and I want this to be done in the DTP class itself.
    For now, I've used an infinite loop and it seems to work fine without lagging the computer (my computer is above average), but I'm not sure if there's another more efficient way.
    I would prefer not to use threads, but if that's the only option then I suppose it's unavoidable.
    I'm using:
    while(true){
        switch(returnState){
        case UNINITIALIZED: continue;
        case SET: return cal.getTime();
        case CANCELED:
            default:
            return null;
    }Screenshots:
    http://i34.tinypic.com/53rb7n.png
    http://i33.tinypic.com/2nsxct4.png
    Azriel~

    You could put any component in a JOptionPane or a JDialog and then easily query the component for results once it has returned.
    For example:
    QueryComponent.java creates a component that can be placed in a JOptionPane and then queried.
    import java.awt.GridLayout;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    import javax.swing.JTextField;
    * A simple component that has two JTextFields and two
    * corresponding "getter" methods to extract information
    * out of the JTextFields.
    * @author Pete
    public class QueryComponent
      private JPanel mainPanel = new JPanel();
      private JTextField firstNameField = new JTextField(8);
      private JTextField lastNameField = new JTextField(8);
      public QueryComponent()
        mainPanel.setLayout(new GridLayout(2, 2, 5, 5));
        mainPanel.add(new JLabel("First Name: "));
        mainPanel.add(firstNameField);
        mainPanel.add(new JLabel("Last Name: "));
        mainPanel.add(lastNameField);
      public String getFirstName()
        return firstNameField.getText();
      public String getLastName()
        return lastNameField.getText();
      // get the mainPanel to place into a JOptionPane
      public JComponent getComponent()
        return mainPanel;
    }QueryComponentTest.java places the component above into a JOptionPane, shows the pane, and then queries the QueryComponent object for the results.
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    public class QueryComponentTest
      private JPanel mainPanel = new JPanel();
      public QueryComponentTest()
        JButton getNamesBtn = new JButton("Get Names");
        getNamesBtn.addActionListener(new ActionListener()
          public void actionPerformed(ActionEvent e)
            getNamesAction();
        mainPanel.add(getNamesBtn);
      // occurs when button is pressed
      private void getNamesAction()
        // create object to place into JOptionPane
        QueryComponent queryComp = new QueryComponent();
        // show JOptionPane
        int result = JOptionPane.showConfirmDialog(mainPanel,
            queryComp.getComponent(), // place the component into the JOptionPane
            "Get Names",
            JOptionPane.INFORMATION_MESSAGE);
        if (result == JOptionPane.OK_OPTION) // if ok selected
          // query the queryComp for its contents by calling its getters
          System.out.println("First Name: " + queryComp.getFirstName());
          System.out.println("Last Name:  " + queryComp.getLastName());
      public JComponent getComponent()
        return mainPanel;
      private static void createAndShowUI()
        JFrame frame = new JFrame("QueryComponentTest");
        frame.getContentPane().add(new QueryComponentTest().getComponent());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }Edited by: Encephalopathic on Sep 29, 2008 8:16 PM

  • Need help changing from CC package to Photoshop only

    I purchased CC membership for one year in December 2013. As I hardly ever need InDesign or Illustrator, I would like to change my order to Photoshop (and Lightroom) only. I find managing my account online very confusing. Is there a number I could call? Or some other way to get rid of the software I don't need, and that I did not re-order after my one-year membership was over?

    Cancel your membership or subscription | Creative Cloud
    https://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
    Phone support | Orders, returns exchanges
    http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
    For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Creative Cloud support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html ( http://adobe.ly/19llvMN )

  • Need help with MAX function to return values

    I am trying to create a report to return slow moving inventory data. One of the requests is that it return only the latest date that an item transacted upon. One sheet will show the last receipt date for a part, another will show the last time a part was issued or shipped on a sales order.
    The hiccup is that it is returning every single last time that an item was received, and every single last issuance of the material (on the second sheet) of items on hand.
    Could someone help me to define the max value function? As listed below, and many variations, the sheet comes up with no data or corrupt dates.
    MAX(Transaction Date MAX) OVER(PARTITION BY Material Transactions.Item ORDER BY Material Transactions.Item )
    Still returns both the following when in reality I just want the one with the most recent date (April 2010).
    100034     BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT     A400M     AB01D..     $0.00     WIP component issue     11-Sep-2009     -3
    100034     BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT     A400M     AD01D..     $0.00     WIP component issue     13-Apr-2010     -16
    Thank you for your assistance.
    Becka

    Hi Becka
    It does look correct. When I look at your data I can see 2 different items:
    100034 BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT A400M AB01D.. $0.00 WIP component issue 11-Sep-2009 -3
    100034 BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT A400M AD01D.. $0.00 WIP component issue 13-Apr-2010 -16
    One is AB01D and the other being AD01D. Is this expected?
    To get the right date you might want to PARTITION BY the BNDSCE-105 which might be the Item Number?
    If you can get your calculation to return the correct date then you next need to put in a new condition where the Transaction Date = MAX Transaction Date
    One part of the function that I would question is the use of MAX in both parts like this: MAX(Transaction Date MAX). You might be better just using MAX(Transaction Date) OVER ......
    Does this help?
    Best wishes
    Michael

  • I need that this query return only one value

    Hi, please. I need your help. I have this query:
    SELECT c.charvalue "Comentario", max(pi.id) as "id" --into :gcpe_last_comment
    FROM twflprocessinstances pi, twfliprocessparameters c
    WHERE pi.id = c.iprocess_id
    AND c.param_id = 1002286
    AND c.charvalue IS NOT NULL
    AND pi.processdef_id = 1600
    AND to_number(pi.id) <> 3817940
    AND to_number(pi.seeparameter1) =80137377
    group by c.charvalue
    having max(pi.id)
    This query return 3 rows, but I need that this query return only one row. The row that this query should return is the row before at the max id. Thanks

    Mmmm...I don't get it.
    You might need to post some sample data and expected results.

Maybe you are looking for

  • How do I delete duplicate emails in Mail 6.2?

    I imported emails from thunderbird, realising I have hundreds of duplicates. Have you any idea how to remove duplicates in Mail 6.2? I tried Mail Scripts but they are not working with Mac OS 10.8. Thanks!

  • Siri in other languages

    I'm about to buy an iPhone 4S in Italy. I read in the FAQ (http://www.apple.com/iphone/features/siri-faq.html) that Siri will be available in Italian in 2012. My question is: will my iPhone 4S be upgraded to the Italian version automatically (or at l

  • One published event doesn't show the right time

    Hi all, I have a published calendar. Created localy on my MacBook. When I go on the web page to see this calendar, very strangely one of the events shows 13:00 on the online calendar but should be at 14:00 (as created in iCal localy). All the other e

  • SATA 3 disk wont work in my Optibay

    When I bought my MBP 2011 I removed the superdrive and put in a HDD caddy into the optibay. I placed an SSD SATA3 in the primary slot and the original disk in the optibay. This worked fine. Last week I bought a 2TB disk which is 15mm and as such need

  • AVCHD wont open with Quicktime player

    I'm using the sony handy cam. Plugged it into the computer and tried selecting all four options on the camcorder (USB connect... etc.) two of them came up with a file AVCHD. I clicked on it and it opened a new window that appeared to be loading, and