Help in understanding GUI's!!!

Hi everyone, I'm new to this type of forum, but I figured it can't hurt to ask for help wherever I can find it. I'm in a Java II class right now, and I'm having a hard time understanding how to build a GUI. I created the programs provided in the book, but I keep getting an error upon compiling, "unreachable statement". I have included my code, I'm not sure how to paste it properly, so I'm sorry if it's hard to read. Please let me know if anyone can help me out here. I'm not sure how much it matters, but the Java Machine we are using is 1.4.2... Thanks for any help!!!
**The first part is this: Rooms.java**
     Chapter 5:     Reserve a Party Room
     Programmer:     Sabrina M. Liberski
     Date:          December 16, 2007
     Filename:     Rooms.java
     Purpose:     This is an external class called by the Reservations.java program.
                    Its constructor method receives the number of nonsmoking and smoking rooms
                    and then creates an array of empty rooms.  The bookRoom() method accepts a
                    boolean value and returns a room number.
public class Rooms
     //declare class variables
     int numSmoking;
     int numNonSmoking;
     boolean occupied[];
     public Rooms(int non, int sm)
          //construct an array of boolean values equal to the total number of rooms
          occupied = new boolean[sm+non];
          for(int i=0; i<(sm+non); i++)
               occupied[i] = false; //set each occupied room to false or empty
          //initialize the number of smoking and nonsmoking rooms
          numSmoking = sm;
          numNonSmoking = non;
     public int bookRoom(boolean smoking)
          int begin, end, roomNumber=0;
          if(!smoking)
               begin = 0;
               end = numNonSmoking;
          else
               begin = numNonSmoking;
               end = numSmoking+numNonSmoking;
          for(int i=begin; i<end; i++)
               if(!occupied) //if room is not occupied
                    occupied[i] = true;
                    roomNumber = i+1;
                    i = end; //to exit loop
          return roomNumber;
}**The second part is:**  /*
     Chapter 5:     Reserve a Party Room
     Programmer:     Sabrina M. Liberski
     Date:          December 16, 2007
     Filename:     Reservations.java
     Purpose:     This program creates a windowed application to reserve a party room.
                    It calls an external class named Rooms.
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;
public class Reservations extends Frame implements ActionListener
     Color lightRed = new Color(255, 90, 90);
     Color lightGreen = new Color(140, 215, 40);
     Rooms room = new Rooms(5,3);
     Panel roomPanel = new Panel();
          TextArea roomDisplay[] = new TextArea[9];
     Panel buttonPanel = new Panel();
          Button bookButton = new Button("Book Room");
     Panel inputPanel = new Panel();
          Label custNameLabel = new Label("Name:");
          TextField nameField = new TextField(15);
          Label custPhoneLabel = new Label("Phone number:");
          TextField phoneField = new TextField(15);
          Label numLabel = new Label("Number in party:");
          Choice numberOfGuests = new Choice();
          CheckboxGroup options = new CheckboxGroup();
               Checkbox nonSmoking = new Checkbox("Nonsmoking", false, options);
               Checkbox smoking = new Checkbox("Smoking", false, options);
               Checkbox hidden = new Checkbox("", true, options);
     public Reservations()
          //set Layouts for frame and three panels
          this.setLayout(new BorderLayout());
               roomPanel.setLayout(new GridLayout(2,4,10,10));
               buttonPanel.setLayout(new FlowLayout());
               inputPanel.setLayout(new FlowLayout());
          //add components to room panel
          for (int i=1; 1<9; i++)
               roomDisplay[i] = new TextArea(null,3,5,3);
               if (i<6)
                    roomDisplay[i].setText("Room " + i + " Nonsmoking");
               else
                    roomDisplay[i].setText("Room " + i + " Smoking");
               roomDisplay[i].setEditable(false);
               roomDisplay[i].setBackground(lightGreen);
               roomPanel.add(roomDisplay[i]);
          //add components to button panel
          buttonPanel.add(bookButton);
          //add components to input panel
          inputPanel.add(custNameLabel);
          inputPanel.add(nameField);
          inputPanel.add(custPhoneLabel);
          inputPanel.add(phoneField);
          inputPanel.add(numLabel);
          inputPanel.add(numberOfGuests);
               for(int i = 8; i<=20; i++)
                    numberOfGuests.add(String.valueOf(i));
          inputPanel.add(nonSmoking);
          inputPanel.add(smoking);
          //add panels to frame
          add(buttonPanel, BorderLayout.SOUTH);
          add(inputPanel, BorderLayout.CENTER);
          add(inputPanel, BorderLayout.NORTH);
          bookButton.addActionListener(this);
          //overriding the windowClosing() method will allow the user to click the Close button
          addWindowListener(
               new WindowAdapter()
                    public void windowClosing(WindowEvent e)
                         System.exit(0);
     }//end of constructor method
     public static void main(String[] args)
          Reservations f = new Reservations();
          f.setBounds(200,200,600,300);
          f.setTitle("Reserve a Party Room");
          f.setVisible(true);
     } //end of main
     public void actionPerformed(ActionEvent e)
          if (hidden.getState())
               JOptionPane.showMessageDialog(null, "You must select Nonsmoking or Smoking.", "Error", JOptionPane.ERROR_MESSAGE);
          else
               int available = room.bookRoom(smoking.getState());
               if (available > 0) //room is available
                    roomDisplay[available].setBackground(lightRed); //display room as occupied
                    roomDisplay[available].setText(
                                                            roomDisplay[available].getText() +
                                                            "\n" +
                                                            nameField.getText() +
                                                            " " +
                                                            phoneField.getText() +
                                                            "\nparty of " +
                                                            numberOfGuests.getSelectedItem()
                                                       ); //display info in room
                    clearFields();
               else //room is not available
                    if (smoking.getState())
                         JOptionPane.showMessageDialog(null, "Smoking is full.", "Error", JOptionPane.INFORMATION_MESSAGE);
                    else
                         JOptionPane.showMessageDialog(null, "Nonsmoking is full.", "Error", JOptionPane.INFORMATION_MESSAGE);
                    hidden.setState(true);
               } //end of else block that checks the available room number
          } //end of else block that checks the state of the hidden option button
     } //end of actionPerformed method
     //reset the text fields and choice component
     void clearFields()
          nameField.setText("");
          phoneField.setText("");
          numberOfGuests.select(0);
          nameField.requestFocus();
          hidden.setState(true);
     } //end of clearFields() method
} //end of Reservations class                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

In order to display a component, that component has to be added to a container that is either that root container or has a parent container that is the root container. You have at least one JPanel, roomPanel, that is added to nothing. You will have to search through this to see if their are others.
But more importantly, you are coding this all wrong. You need to code like so:
1) create your class skeleton, see that it compiles and runs.
2) add enough to make a JFrame appear, nothing more. Make sure it compiles, runs, and you see the frame.
3) add code a little bit at a time, and after each addition, compile and run the code, make sure that you see any visual elements.
4) repeat section 3 until project done.
5) for larger projects, I create separate classes and run each one with its own main method to check it as I create it before adding it to the greater program.
If you don't do it this way, you will end up with a mess where when you correct one error, three more show up.
Also, I recommend that when an error or problem pops up like one did just now (invisible components) that you work on debugging it first for at least 1-2 hours before coming to the forum for answers. Otherwise you don't learn how to debug, an important skill to master.
Edited by: petes1234 on Dec 17, 2007 10:11 AM

Similar Messages

  • Need help..anyone GUI Interfaces

    http://forum.java.sun.com/thread.jsp?forum=31&thread=472147&tstart=0&trange=15
    Can someone please help me with this program..I'm new to java and I don't understand GUI's. I read everything inside and out in my text book and still don't get how to convert my program into a gui interface...please help.

    Sorry i accidently posted twice...
    But here is my topic incase the link did not work. Thanks! Really desperate!
    Develop a Java application that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:
    a) Account Balance
    b) Balance at the beginning of the month
    c) Total of all items charged by this customer this month
    d) Total of all credits applied to the customer&#8217;s account this month
    e) Allowed credit limit
    This program should input each of these facts from input dialogs as integers, calculate the new balance, display the new balance and determine if the new balance exceeds the customer&#8217;s credit limit. For those customers whose credit limit is exceeded, the program should display the message, &#8220;Credit limit exceeded.&#8221;
    Here is the program I wrote : (for the above criteria)
    // Credit.java
    // Program monitors accounts
    import java.awt.*;
    import javax.swing.JOptionPane;
    public class Credit {
    public static void main( String args[] )
    String inputString;
    int account, newBalance,
    oldBalance, credits, creditLimit, charges;
    inputString =
    JOptionPane.showInputDialog( "Enter Account (-1 to quit):" );
    while ( ( account = Integer.parseInt( inputString ) ) != -1 ) {
    inputString =
    JOptionPane.showInputDialog( "Enter Balance: " );
    oldBalance = Integer.parseInt( inputString );
    inputString =
    JOptionPane.showInputDialog( "Enter Charges: " );
    charges = Integer.parseInt( inputString );
    inputString =
    JOptionPane.showInputDialog( "Enter Credits: " );
    credits = Integer.parseInt( inputString );
    inputString =
    JOptionPane.showInputDialog( "Enter Credit Limit: " );
    creditLimit = Integer.parseInt( inputString );
    newBalance = oldBalance + charges - credits;
    String resultsString, creditStatusString;
    resultsString = "New balance is " + newBalance;
    if ( newBalance > creditLimit )
    creditStatusString = "CREDIT LIMIT EXCEEDED";
    else
    creditStatusString = "Credit Report";
    JOptionPane.showMessageDialog(
    null, resultsString,
    creditStatusString,
    JOptionPane.INFORMATION_MESSAGE );
    inputString =
    JOptionPane.showInputDialog( "Enter Account (-1 to quit):" );
    System.exit( 0 );
    AND I NEED TO MODIFY IT TO DO THE FOLLWOING: (I'M A NEWB AND IT'S TAKEN ME FOREVER JUST TO DO THE ABOVE..PLEASE ANY HELP WOULD BE GREAT!!
    Expand the above program.
    1) Design an appropriate GUI for input. You cannot use dialog boxes. Design functional window(s) from scratch. State your conditions in the boxed comment at the top of the class. Input will need a transaction date also for the CustomerHistory class.
    2) Add a customer # ( a unique identifier)
    3) Besides your GUI, you will want 2 other classes: Customer and CustomerHistory. CustomerHistory will serve as a mock database.
    4) CustomerHistory will hold the previous balance & allowed credit limit plus any credit violation history. Your CustomerHistory violations must be an array, so that it could be readily expandable.
    5) Some step-up is necessary &#8211; chose your own approach and document.
    6) Then run your system enough times to show the response when a customer exceeds THREE &#8216;over credit&#8217; limits. CustomerHistory violations should be printed out, as well as, our choice of a &#8216;dunning notice&#8217;. It cannot be the same as a simple one time exceeds limit. Also show a normal customer run. Prove to me your solution works!
    7) Draw the UML diagram of your interconnecting classes.

  • I need help with the GUI nad Graphic 2D....

    Hi
    i'm kind new to java and i have couple of questions... all my questions about the GUI...
    when i want to create a GUI programe , and when i want to draw a graphic with GUI, i do that way(code)
    "public class x1 extends JPanle{
         public void PaintComponent(Graphic g){
    My questions:
    1) why do i have to extend from JPanle ??
    2) Why do i use paintcomponent??? why i couldn't use directly 'Graphic g' ??
    This code i get it from the book, this is how it is done...
    Also, if i want to draw some shapes(rec, circle ..etc) and i want to put Button and organize them, how could i do that???
    i tried to organize the button after i draw the rectangle but i can't... all becaus of the stupid way'the code that i wrote it', i hope there is an alternative way.
    My last question... how can i change the font ???
    i want to use 'sans comic'...
    Thanks alot....

    kiiwii14 wrote:
    i'm kind new to java and i have couple of questions...fair enough.
    all my questions about the GUI...and that's your problem right there.
    Your questions tell me that you're missing quite a few fundamentals of programming in Java. There's nothing wrong with that, everyone starts this way. But if you try to do any GUI programming at your current level you will run head-first into many, many problems that could be easily avoided if you concentrate on learning the basics first.
    when i want to create a GUI programe , and when i want to draw a graphic with GUI, i do that way(code)
    "public class x1 extends JPanle{That code doesn't compile. It's JPanel, not JPanle. Please post only compiling code (or near it, if you've got a question about a compiler error).
         public void PaintComponent(Graphic g){"paintCompontent", not "PaintComponent".
    Oh, and in the future please use the CODE-Button when posting code (1. copy+paste code 2. select code 3. press "CODE" just above the text area).
    My questions:
    1) why do i have to extend from JPanle ??You don't have to. You can, if you want your class to be a specific type of JPanel.
    2) Why do i use paintcomponent??? why i couldn't use directly 'Graphic g' ??How would you "directly use Graphic g"?
    That's the way the framework is written. Components draw themselves using that method. If you want to change how they draw themselves you can override that method.
    Did you read the chapter that tells you this or did you simply copy out the code example? The examples are there to illustrate the points and help you understand. They are not a *substitute* to actually reading the text.
    Also, if i want to draw some shapes(rec, circle ..etc) and i want to put Button and organize them, how could i do that???Finish reading the book, write some basic programs and then work on from there.
    You're trying to learn a feature and produce a useful product at the same time. I can tell you from experience that this is a very bad idea.
    i tried to organize the button after i draw the rectangle but i can't... How did you try?
    all becaus of the stupid way'the code that i wrote it', i hope there is an alternative way.You didn't show us your attempt so we can't tell you any alternative.
    My last question... how can i change the font ???
    i want to use 'sans comic'... Hm ... "Comic Sans" is the name. And that's not a font. [It's a desease|http://bancomicsans.com/].

  • Error Posting IDOC: need help in understanding the following error

    Hi ALL
    Can you please, help me understand the following error encountered while the message was trying to post a IDOC.
    where SAP_050 is the RFC destination created to post IDOCs
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_RUNTIME</SAP:Code>
      <SAP:P1>FM NLS_GET_LANGU_CP_TAB: Could not determine code page with SAP_050 Operation successfully executed FM NLS_GET_LANGU_CP_TAB</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error: FM NLS_GET_LANGU_CP_TAB: Could not determine code page with SAP_050 Operation successfully executed FM NLS_GET_LANGU_CP_TAB</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Your help is greatly appreciated.............Thank you!

    Hi Patrick,
      Check the authorizations assigned to the user which you used in the RFC destinations, If there is no enough authorizations then it is not possible to post the idocs.
    Also Refer this Note 747322
    Regards,
    Prakash

  • E-Rows = NULL and A-Rows=42M? Need help in understanding why.

    Hi,
    Oracle Standard Edition 11.2.0.3.0 CPU Oct 2012 running on Windows 2008 R2 x64. I am using Oracle 10g syntax for WITH clause as the query will also run on Oracle 10gR2. I do not have a Oracle 10gR2 environment at hand to comment if this behaves the same.
    Following query is beyond me. It takes around 2 minutes to return the "computed" result set of 66 rows.
    SQL> WITH dat AS
      2          (SELECT 723677 vid,
      3                  243668 fid,
      4                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
      5                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
      6             FROM DUAL
      7           UNION ALL
      8           SELECT 721850,
      9                  243668,
    10                  TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
    11                  TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
    12             FROM DUAL
    13           UNION ALL
    14           SELECT 723738,
    15                  243668,
    16                  TO_DATE ('16.03.2013', 'dd.mm.yyyy'),
    17                  TO_DATE ('  04.04.2013', 'dd.mm.yyyy')
    18             FROM DUAL)
    19      SELECT /*+ GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
    20        FROM dat
    21  CONNECT BY LEVEL <= maxdt - mindt + 1
    22  order by fid, vid, dtshow;
    66 rows selected.
    SQL>
    SQL> SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  9c4vma4mds6zk, child number 0
    WITH dat AS         (SELECT 723677 vid,                 243668 fid,
                TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
    TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt            FROM DUAL
    UNION ALL          SELECT 721850,                 243668,
       TO_DATE ('06.02.2013', 'dd.mm.yyyy'),                 TO_DATE ('
    22.03.2013', 'dd.mm.yyyy')            FROM DUAL          UNION ALL
        SELECT 723738,                 243668,                 TO_DATE
    ('16.03.2013', 'dd.mm.yyyy'),                 TO_DATE ('  04.04.2013',
    'dd.mm.yyyy')            FROM DUAL)     SELECT /*+
    GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
        FROM dat CONNECT BY LEVEL <= maxdt - mindt + 1 order by fid, vid,
    dtshow
    Plan hash value: 1865145249
    | Id  | Operation                              | Name | Starts | E-Rows | A-Rows |   A-Time   |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                       |      |      1 |        |     66 |00:01:54.64 |       |       |          |
    |   1 |  SORT UNIQUE                           |      |      1 |      3 |     66 |00:01:54.64 |  6144 |  6144 | 6144  (0)|
    |   2 |   CONNECT BY WITHOUT FILTERING (UNIQUE)|      |      1 |        |     42M|00:01:04.00 |       |       |          |
    |   3 |    VIEW                                |      |      1 |      3 |      3 |00:00:00.01 |       |       |          |
    |   4 |     UNION-ALL                          |      |      1 |        |      3 |00:00:00.01 |       |       |          |
    |   5 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    |   6 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    |   7 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    --------------------------------------------------------------------------------------------------------------------------If I take out one of the UNION queries, the query returns in under 1 second.
    SQL> WITH dat AS
      2          (SELECT 723677 vid,
      3                  243668 fid,
      4                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
      5                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
      6             FROM DUAL
      7           UNION ALL
      8           SELECT 721850,
      9                  243668,
    10                  TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
    11                  TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
    12             FROM DUAL)
    13      SELECT /*+ GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
    14        FROM dat
    15  CONNECT BY LEVEL <= maxdt - mindt + 1
    16  order by fid, vid, dtshow;
    46 rows selected.
    SQL>
    SQL> SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  1d2f62uy0521p, child number 0
    WITH dat AS         (SELECT 723677 vid,                 243668 fid,
                TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
    TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt            FROM DUAL
    UNION ALL          SELECT 721850,                 243668,
       TO_DATE ('06.02.2013', 'dd.mm.yyyy'),                 TO_DATE ('
    22.03.2013', 'dd.mm.yyyy')            FROM DUAL)     SELECT /*+
    GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
        FROM dat CONNECT BY LEVEL <= maxdt - mindt + 1 order by fid, vid,
    dtshow
    Plan hash value: 2232696677
    | Id  | Operation                              | Name | Starts | E-Rows | A-Rows |   A-Time   |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                       |      |      1 |        |     46 |00:00:00.01 |       |       |          |
    |   1 |  SORT UNIQUE                           |      |      1 |      2 |     46 |00:00:00.01 |  4096 |  4096 | 4096  (0)|
    |   2 |   CONNECT BY WITHOUT FILTERING (UNIQUE)|      |      1 |        |     90 |00:00:00.01 |       |       |          |
    |   3 |    VIEW                                |      |      1 |      2 |      2 |00:00:00.01 |       |       |          |
    |   4 |     UNION-ALL                          |      |      1 |        |      2 |00:00:00.01 |       |       |          |
    |   5 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    |   6 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    26 rows selected.What I cannot understand is why the E-Rows is NULL for "CONNECT BY WITHOUT FILTERING (UNIQUE)" step and A-Rows shoots up to 42M for first case. The behaviour is the same for any number of UNION queries above two.
    Can anyone please help me understand this and aid in tuning this accordingly? Also, I would be happy to know if there are better ways to generate the missing date range.
    Regards,
    Satish

    May be, this?
    WITH dat AS
                (SELECT 723677 vid,
                        243668 fid,
                        TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
                        TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
                   FROM DUAL
                 UNION ALL
                 SELECT 721850,
                        243668,
                       TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
                       TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
                  FROM DUAL
                UNION ALL
                SELECT 723738,
                       243668,
                       TO_DATE ('16.03.2013', 'dd.mm.yyyy'),
                       TO_DATE ('  04.04.2013', 'dd.mm.yyyy')
                  FROM DUAL)
           SELECT  vid, fid, mindt - 1 + LEVEL dtshow
             FROM dat
      CONNECT BY LEVEL <= maxdt - mindt + 1
          and prior vid = vid
          and prior fid = fid
          and prior sys_guid() is not null
      order by fid, vid, dtshow;
    66 rows selected.
    Elapsed: 00:00:00.03

  • Can you help me understand the use of the word POSITION in TR and CFM?

    Hi,
    I am trying to have a view of typical BI reports in TR and TM/CFM so through my research I came to the following link:.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/62/08193c38f98e1ce10000000a11405a/frameset.htm
    My problem on this link and other postings on this site seem to be the same. Can you help me understand the use of the word POSITIONS in these context:
    1. Our client has asked for financial transaction reports in BW, such as position of Borrowings, Investments and Hedge Operations (TM data).
    2. I have a requirement on, some reports related to Money Market (Fixed Term Deposits, Deposits at Notice) something on FSCM-Treasury and Risk Manager. These reports will be similar to that of Loans, i.e. Position statement, flow statement, etc.
    3. The set of position values for a single position or a limited amount of positions can be reported by transactions TPM12 and TPM13 in R3.
    4. 0CFM_C10 (Financial Positions Cube)
    Do you have some simple report outputs to help clarify how the word POSITION is used in such environments?
    Thanks
    Edited by: AmandaBaah on Feb 15, 2010 4:39 PM

    If I future buy 10 shares in company at £1 per share - at the end of the day my potential value is £10
    The next day the shares drop tp £0.9 per share - I have a negative position - my shares are only worth £9
    I haven;t bought them yet - but I have a negative position - ie if things stayed as they are - I am going to realise (ie end up with)  a loss
    Now you can use this for loans and foreign exchange banks as well...

  • Need help in understanding why so many gets and I/O

    Hi there,
    I have a sql file somewhat similar in structure to below:
    delete from table emp;-- changed to Truncate table emp;
    delete from table dept;--changed to Truncate table dept;
    insert into emp values() select a,b,c from temp_emp,temp_dept where temp_emp.id=temp_dept.emp_id
    update emp set emp_name=(select emp_name from dept where emp.id=dept.emp_id);
    commit --only at the end
    the above file takes about 9-10 hrs to complete its operation. and
    the values from v$sql for the statement
    update emp set emp_name=(select emp_name from dept where emp.id=dept.emp_id);
    are as below:
    SHARABLE_MEM     PERSISTENT_MEM     RUNTIME_MEM     SORTS     LOADED_VERSIONS     OPEN_VERSIONS     USERS_OPENING     FETCHES     EXECUTIONS     PX_SERVERS_EXECUTIONS     END_OF_FETCH_COUNT     USERS_EXECUTING     LOADS     FIRST_LOAD_TIME     INVALIDATIONS     PARSE_CALLS     DISK_READS     DIRECT_WRITES     BUFFER_GETS     APPLICATION_WAIT_TIME     CONCURRENCY_WAIT_TIME     CLUSTER_WAIT_TIME     USER_IO_WAIT_TIME     PLSQL_EXEC_TIME     JAVA_EXEC_TIME     ROWS_PROCESSED     COMMAND_TYPE     OPTIMIZER_MODE     OPTIMIZER_COST     OPTIMIZER_ENV     OPTIMIZER_ENV_HASH_VALUE     PARSING_USER_ID     PARSING_SCHEMA_ID     PARSING_SCHEMA_NAME     KEPT_VERSIONS     ADDRESS     TYPE_CHK_HEAP     HASH_VALUE     OLD_HASH_VALUE     PLAN_HASH_VALUE     CHILD_NUMBER     SERVICE     SERVICE_HASH     MODULE     MODULE_HASH     ACTION     ACTION_HASH     SERIALIZABLE_ABORTS     OUTLINE_CATEGORY     CPU_TIME     ELAPSED_TIME     OUTLINE_SID     CHILD_ADDRESS     SQLTYPE     REMOTE     OBJECT_STATUS     LITERAL_HASH_VALUE     LAST_LOAD_TIME     IS_OBSOLETE     CHILD_LATCH     SQL_PROFILE     PROGRAM_ID     PROGRAM_LINE#     EXACT_MATCHING_SIGNATURE     FORCE_MATCHING_SIGNATURE     LAST_ACTIVE_TIME     BIND_DATA     TYPECHECK_MEM
    18965     8760     7880     0     1     0     0     0     2     0     2     0     2     2011-05-10/21:16:44     1     2     163270378     0     164295929     0     509739     0     3215857850     0     0     20142     6     ALL_ROWS     656     E289FB89A4E49800CE001000AEF9E3E2CFFA331056414155519421105555551545555558591555449665851D5511058555155511152552455580588055A1454A8E0950402000002000000000010000100050000002002080007D000000000002C06566001010000080830F400000E032330000000001404A8E09504646262040262320030020003020A000A5A000     4279923421     50     50     APPS     0     00000003CBE5EF50     00     1866523305     816672812     1937724149     0     SYS$USERS     0     01@</my.sql     -2038272289          -265190056     0          9468268067     10420092918          00000003E8593000     6     N     VALID     0     2011-05-11/10:23:45     N     5          0     0     1.57848E+19     1.57848E+19     5/12/2011 4:39          0
    1) how do i re-write this legacy script? and what should be done to improve performance?
    2) Should i use PL/sql to re-write it?
    3) Also help in understanding why a simple update statement is doing so many buffer gets and reading , Is this Read consistency Trap as i'm not committing anywhere in between or it is actually doing so much of work.
    (assume dept table has cols emp_name and emp_id also)

    update emp set emp_name=(select emp_name from dept where emp.id=dept.emp_id);I guess that these are masked table names ? Nobody would have emp_name in a dept table.
    Can you re-format the output, using "code" tags ( [  or {  }
    Hemant K Chitale
    Edited by: Hemant K Chitale on May 12, 2011 12:44 PM

  • Duplicate partitions, need help to understand and fix.

    So I was looking for a USB that I plugged in and went into /media/usbhd-sdb4/miles and realized all its contents was from my home directory.
    So I created a random file in my home directory to see if it would also update /media/usbhd-sdb4/miles , and it did.
    Can someone help me understand what is happening?
    Also if I can fuse sdb4 and sdb2 as one, and partition it as my home directory without losing its contents?
    Below is some information that I think would be helpful.
    Thank you.
    [miles]> cd /media/usbhd-sdb4/
    [usbhd-sdb4]> ls -l
    total 20
    drwx------ 2 root root 16384 May 28 14:16 lost+found
    drwx------ 76 miles users 4096 Oct 15 00:42 miles
    [usbhd-sdb4]> cd miles
    [miles]> pwd
    /media/usbhd-sdb4/miles
    [miles]>
    lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 465.8G 0 disk
    ├─sda1 8:1 0 19.5G 0 part
    └─sda2 8:2 0 446.2G 0 part
    sdb 8:16 0 465.8G 0 disk
    ├─sdb1 8:17 0 102M 0 part /media/usbhd-sdb1
    ├─sdb2 8:18 0 258.9M 0 part [SWAP]
    ├─sdb3 8:19 0 14.7G 0 part /
    └─sdb4 8:20 0 450.8G 0 part /media/usbhd-sdb4
    sr0 11:0 1 1024M 0 rom

    Check your udev rules...

  • Need help for understanding the behaviour of these 2 queries....

    Hi,
    I need your help for understanding the behaviour of following two queries.
    The requirement is to repeat the values of the column in a table random no of times.
    Eg. A table xyz is like -
    create table xyz as
    select 'A' || rownum my_col
    from all_objects
    where rownum < 6;
    my_col
    A1
    A2
    A3
    A4
    A5
    I want to repeat each of these values (A1, A2,...A5) multiple times - randomly decide. I have written the following query..
    with x as (select my_col, trunc(dbms_random.value(1,6)) repeat from xyz),
    y as (select level lvl from dual connect by level < 6)
    select my_col, lvl
    from x, y
    where lvl <= repeat
    order by my_col, lvl
    It gives output like
    my_col lvl
    A1     1
    A1     3
    A1     5
    A2     1
    A2     3
    A2     5
    A3     1
    A3     3
    A3     5
    A4     1
    A4     3
    A4     5
    A5     1
    A5     3
    A5     5
    Here in the output, I am not getting rows like
    A1     2
    A1     4
    A2     2
    A2     4
    Also, it has generated the same set of records for all the values (A1, A2,...,A5).
    Now, if I store the randomly-decided value in the table like ---
    create table xyz as
    select 'A' || rownum my_col, trunc(dbms_random.value(1,6)) repeat
    from all_objects
    where rownum < 6;
    my_col repeat
    A1     4
    A2     1
    A3     5
    A4     2
    A5     2
    And then run the query,
    with x as (select my_col, repeat from xyz),
    y as (select level lvl from dual connect by level < 6)
    select my_col, lvl
    from x, y
    where lvl <= repeat
    order by my_col, lvl
    I will get the output, exactly what I want ---
    my_col ....lvl
    A1     1
    A1     2
    A1     3
    A1     4
    A2     1
    A3     1
    A3     2
    A3     3
    A3     4
    A3     5
    A4     1
    A4     2
    A5     1
    A5     2
    Why the first approach do not generate such output?
    How can I get such a result without storing the repeat values?

    If I've understood your requirement, the below will achieve it:
    SQL> create table test(test varchar2(10));
    Table created.
    SQL> insert into test values('&test');
    Enter value for test: bob
    old   1: insert into test values('&test')
    new   1: insert into test values('bob')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: terry
    old   1: insert into test values('&test')
    new   1: insert into test values('terry')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: steve
    old   1: insert into test values('&test')
    new   1: insert into test values('steve')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: roger
    old   1: insert into test values('&test')
    new   1: insert into test values('roger')
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select lpad(test,(ceil(dbms_random.value*10))*length(test),test) from test;
    LPAD(TEST,(CEIL(DBMS_RANDOM.VALUE*10))*LENGTH(TEST),TEST)
    bobbobbobbobbobbobbobbobbobbob
    terryterry
    stevestevesteve
    rogerrogerrogerrogerrogerrogerrogerrogerrogerYou can alter the value of 10 in the SQL if you want the potential for a higher number of names.
    Andy

  • Need help in understanding FA acquisition via Internal Order

    Hi Gurus
    I need your help in understanding the FA acquisition via Internal Order. The process we are following is that we create AUC using the AUC asset class and enter that AUC number in the settlement rule while creating IO. Once IO budget is approved, we release the IO. Once GR is completed, we do the Invoice receipt for the PO, followed by settlement of IO against the AUC. Afterwards, we create fixed asset in AS01 and enter this asset number in the settlement rule for the AUC in AIAB and settle the AUC to Fixed asset for the costs.
    My question is that during all this process, I don't see the PO information in the AUC record. When I display AUC, under the Enviornment tab, I see the Purchase order link but when I click it, there is nothing in there. The reason could be that we are creating AUC seperatly and not from within the IO where it says create AUC. I am not sure what is the best way for the whole process.
    I would be thankful if you can guide me.
    Thanks,
    Shalu

    Hi
    Can someone please help me with this issue?
    Thanks,
    Shalu

  • Need help in understanding the error ORA-01843: not a valid month - ECX_ACT

    Hello All,
    We need help in understanding the Transaction Monitor -> Processing Message (error "ORA-01843: not a valid month - ECX_ACTIONS.GET_CONVERTED_DATE").
    And how to enable the log for Transaction Monitor -> Processing Logfile.
    Actually we are trying to import the Purchase Order XML (OAG) into eBusiness Suite via BPEL Process Manager using the Oracle Applications Adapter. The process is working fine with expected payload until it reaches the XML Gateway Transaction Monitor, where we are getting this error.
    thanks
    muthu.

    Hello All,
    We need help in understanding the Transaction Monitor -> Processing Message (error "ORA-01843: not a valid month - ECX_ACTIONS.GET_CONVERTED_DATE").
    And how to enable the log for Transaction Monitor -> Processing Logfile.
    Actually we are trying to import the Purchase Order XML (OAG) into eBusiness Suite via BPEL Process Manager using the Oracle Applications Adapter. The process is working fine with expected payload until it reaches the XML Gateway Transaction Monitor, where we are getting this error.
    thanks
    muthu.

  • HT3529 Can someone help me understand why my iMessage no longer works on my iPad

    Can someone help me understand why my iMessage no longer works on my iPad

    iOS: Troubleshooting Messages
    iOS: Troubleshooting FaceTime and iMessage activation

  • I try to sync my nano and get:  the ipod cant be synced because there is not enough free space to hold all of the items in the items library (need 100MB) - I have a new computer?? can you help me understand this message: what to do?

    I try to sync my nano and get:  the ipod cant be synced because there is not enough free space to hold all of the items in the items library (need 100MB) - I have a new computer?? can you help me understand this message: what to do?

    Hello pryan1012,
    What this message means is that you have more music in your itunes library than there is free space in your ipod.
    I had this same issue at one time. This is what helped me put my music on the ipod. I used manually manage.
    Learn how to sync muisc here.
    Hope this helps.
    ~Julian

  • Lightroom 5.2 won't open after "successfully installed" - can anybody please help me understand why?

    Hi everyone
    I've bought and downloaded Adobe Lightroom 5 for a new iMac 27" intel core 5 3,4 GHz. The machine is only three days old and no more updates are to be found when searching for it. However; after the message that "lightroom 5 has successfully been installed" I don't get to open the program. So I never get to the point where I can register the serial number / registration key for purchased product.
    I've followed the instructions that comes with Lightroom 5, but no luck. Also tried to uninstall and reinstall.
    No secret that I'm total incompetent when it comes to understanding of computers and software....
    Hope someone can help me understand what I'm doing wrong, and sugest some good solutions :-)
    Thx

    I think you may need to uninstall and then start over. There is no installer on the Mac for Lightroom so select it in Applications and send it to the trash.  I suggest you download again from a different source. You can use the link below to download the free trial and then validate the software after installation with your product serial number. Ensure you choose your language version and MAC platform from the dropdown list at the top of the page.
    After you click download it starts by downloading or updating (replace) the Adobe Download Assistant. You then browse the products and select Photoshop Lightroom 5 to start the installation.
    https://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_lightroom&promoid&promoid=D TEML

  • Hi, can anyone help me out with this, I need some help on designing GUI for e-learning coursewares. Some tutorials or some helpful sites will do.

    I need some help with the GUI design.

    Have you tried the line inputs on the back of your FirePod? If you update its firmware (not sure if you will need to or not), I seem to remember hearing that the FirePod can run without FW connection, i.e. stand alone. In this mode with the outs from your mixer into line ins 1-2 (2nd from left on the back) it should work fine. I say should because I have never tried. However, these are used for returns from an external effects unit. I assume here, and the important word is assume, that there are two so that they can be used as a stereo send or as a mono send. Worth a try! Let us know how it goes.
    Best, Fred

Maybe you are looking for

  • Text entry box question

    Hey all, I am currently working on a project and have run into a snag and cant seem to find the answer, or even if what i need can be done. Question 1: how do I advance a slide with the correct entry of a text field without a button or keypress? Ques

  • PDF to Excel to CSV

    i'm trying to convert some bank statements which are in PDF format to Excel.I then want to save the file as a CSV file and import the files into Xero accounting system. Is this achievable with Adobe products.

  • How can i fix my wifi connection with my router

    how can i fix my wifi connection with my router?

  • Trying to Migrate from MS SQL server 7.0

    I have downloaded the Migration workbench and on install I am getting the error "Oracle Migration Workbench can only be installed into an new ORACLE_HOME or an existing 8.1.6 ORACLE_HOME." I am new to Oracle and I am trying to make the switch from SQ

  • External Material Number range

    Dear all, Is it possible if I define external number range only with numbers not alphabet. I have defined external number range as 000000001 to zzzzzzzzzzzz but its not accepting external number as 10000203030 when creating material master. Pls guide