Need help getting a very simple RMI program running

I've been pulling my hair out trying to get RMI running on windows. I decided to do a verbatim copy of a tutorial to see if it would work, well it didn't. Here is the sample code:
//HelloInterface.java - located in dir c:\java
import java.rmi.*;
public interface HelloInterface extends Remote {
public String say() throws RemoteException;
//Hello.java - located in c:\java
import java.rmi.*;
import java.rmi.server.*;
public class Hello extends UnicastRemoteObject implements HelloInterface {
private String message;
public Hello (String msg) throws RemoteException {
message = msg;
public String say() throws RemoteException {
return message;
//HelloServer.java - located in c:\java
import java.rmi.*;
import java.rmi.Naming;
public class HelloServer{
public static void main (String[] argv) {
try {
Naming.rebind ("Hello", new Hello ("Hello, world!"));
System.out.println ("Hello Server is ready.");
} catch (Exception e) {
System.out.println ("Hello Server failed: " + e);
Then I open a command prompt and go to c:\java and type:
C:\java>javac HelloInterface.java
C:\java>javac Hello.java
C:\java>rmic Hello
C:\java>javac HelloServer.java
I then open a second command prompt and navigate to c:\registry to (to avoid being in the same directory as the stub files) and type:
C:\register>C:\j2sdk1.4.2_03\bin\rmiregistry
In the original command prompt, I then run HelloServer. I've tried running it a 100 different ways and always get the same error:
Hello Server failed: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Hello_Stub
I've tried just running it as:
java HelloServer
java -classpath . HelloServer
C:\java>java -Djava.rmi.server.codebase=http://localhost -classpath . HelloServer
C:\java>java -Djava.security.policy=..\policy.all -Djava.rmi.server.codebase=http://localhost -classpath . HelloServer
Where policy.all is:
grant {
     permission java.security.AllPermission;
And pretty much just about every combination of the above that you can think of.

//HelloInterface.java - located in dir c:\java
import java.rmi.*;
public interface HelloInterface extends Remote {
  public String say() throws RemoteException;
}//Hello.java - located in c:\java
import java.rmi.*;
import java.rmi.server.*;
public class Hello extends UnicastRemoteObject implements HelloInterface {
  private String message;
  public Hello (String msg) throws RemoteException {
    message = msg;
  public String say() throws RemoteException {
    return message;
}//HelloServer.java - located in c:\java
import java.rmi.*;
import java.rmi.Naming;
public class HelloServer{
  public static void main (String[] argv) {
    try {
      Naming.rebind ("Hello", new Hello ("Hello, world!"));
      System.out.println ("Hello Server is ready.");
    } catch (Exception e) {
      System.out.println ("Hello Server failed: " + e);
}I'm not sure what you are saying about the CLASSPATH. I thought rmiregistry had to be ran in a different directory than the stub files and that the stubs shouldn't be in the CLASSPATH of the terminal launching rmiregistry.
The HelloServer is being ran with the -classpath option set to "." and the stubs are in the same directory.

Similar Messages

  • Need help with a very simple example.  Trying to reference a value

    Im very new to Sql Load and have created this very simple example of what I need to do.
    I just want to reference the ID column from one table to be inserted into another table as DEV_ID.
    Below are my: 1) Control File, 2) Datafile, 3) Table Description, 4) Table Description
    1) CONTROL FILE:
    LOAD DATA
    INFILE 'test.dat'
    APPEND
    INTO TABLE p_ports
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    DEV_id REF(CONSTANT 'P_DEVICES',NAME),
    NAME FILLER ,
    PORT_NO
    2) DATAFILE:
    COMM881-0326ES09,6
    3) TABLE DESCRIPTION:
    SQL> describe p_ports
    Name Null? Type
    ID NOT NULL NUMBER(10)
    DEV_ID NOT NULL NUMBER(10)
    PORT_NO     NUMBER(3)

    hi,
    i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
    i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
    1) from the appdelegate i initialize a root controller (view controller class)
    2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
    3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
    4) we also need viewA and viewB files(view class)
    5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
    5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
    it will look something like this:
    [Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
    so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
    i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps.

  • [New] Help with a VERY simple asterisk program.

    Alright...I feel like a complete idiot asking this question..but I'm having such trouble writing this program. The program description is here:
    Write a Java application using two for loops to produce the following pattern of asterisks.
    I guess I'm really bad at algorithms yeah? Haha...well, any help would be very much appreciated.

    Hi,
    I don't think you don't need to look through any C programming books.
    When you have a problem like this, do some thinking about what methods you need to use and what the general structure of the program will be.
    You need to print asterisks out to the screen... so you'll need:
    System.out.println
    System.out.printAnd you already know that you need two loops.
    Now you can ask yourself how you might use the print statements with two loops in order to design a basic structure for the program.
    You have 8 lines, so you might want a loop that runs through 8 times, one of the lines printed each time.
    Within this loop, you need another loop that prints out *'s. This loop could run once for each asterisk, but because there is a different number of asterisks on each line, the number of times this loop runs would be variable.
    So a basic structure:
    //loop1 that runs 8 times
        //loop2 that runs once for each *
            print one star
        //end loop2
    //end loop1The key now is to recognise the difference between print and println. I don't know if you alread know, but System.out.print will print a string without creating a new line at the end, and println will create a new line at the end of the printed string.
    Hope that helps. If you have any other problems, post specific questions along with the code you've written and are having trouble with.

  • Need help with something VERY SIMPLE

    I'm brand new to Motion - as if today - but I'm only trying to do some VERY simple motions with photos - a simultaneous zoom in and reposition. What I've been doing is setting the starting key frame at one position (adjusting the x, y) and setting the scale. Then I create a second key frame and adjust the postion and scale. It will do the zoom, but then it re adjusts the starting position. If I readjust the starting key frame, it automatically readjusts the second key frame. I don't get it! Applying the various 'behaviors' doesn't seen to help. Certainly there's something obvious here that I'm missing - as I was able to do this in FCP. For some reason the key frames are not fixed when it comes to position.

    hi,
    a couple of thoughts?
    did you actually set a keyframe for position at the first frame?
    Also unless you are parked right on a keyframe or have the record button on, if you adjust a value, all the values for all keyframes adjust accordingly. I often mess something up because I wasnt parked on a keyframe.
    hth
    adam

  • Need Help with a very simple view transition scenario

    Hello All,
    I am trying to learn how view transitions work and I am having a very hard time with the sample apps (like transition view app etc)...I need something much more simple at first. Can you please provide me a little guidelines on how to set up this following scenario:
    App loads up and shows a title screen with a button that says go. When you click on the go button the title screen fades out and a new view fades in (or slides in, or anything at all).
    Right now I have 3 nib files. There is the main one that is called on application start (tied with MainViewController, a subclass of IUViewcontroller just like in the hello world app. After the app loads the app delegate object tells the MainViewController object to load in another view controller object (via addSubview) which is tied with the second nib file; my title screen with the button. When I press the button I was thinking in the IBAction function to tell the MainViewController object to remove (or transition out somehow) the title screen view controller object then add the other view (third nib file in). This is the part I can't get working. Am I on the right track or have a gone hideously astray? Thank you!

    hi,
    i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
    i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
    1) from the appdelegate i initialize a root controller (view controller class)
    2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
    3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
    4) we also need viewA and viewB files(view class)
    5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
    5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
    it will look something like this:
    [Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
    so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
    i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps.

  • I have Photoshop Elements 12 that was purchased for my Windows 8 system in July of 2014.  I have never been able to get the organizer to work.  I need help getting this portion of the program to work.  I would like to talk with an Adobe tech.

    How is it that I can download and use Photoshop Elements 12 program editor and not have access to the organizer???

    Hi,
    The two applications (organizer & editor) can work independently and only talk to each other when they need to.
    Are you updating from a previous version or is this the first?
    There are (at least) three ways of starting the organizer:-
    1) from the Welcome screen
    2) from the editor - see button at the bottom of the editor window
    3) directly using windows explorer to locate and double click on the following
    "C:\Program Files (x86)\Adobe\Elements 12 Organizer\PhotoshopElementsOrganizer.exe"
    [ignore the (x86) part if on 32bit system]
    Can you get any of those ways to work? Do you get any error message or does nothing happen?
    You could try creating a new catalog to see if that helps.
    Start the organizer (in any of the ways) with the Shift key held down while it loads (if it does). That should bring up the catalog manager
    Click on the New button (top right)
    Give it a name like Dummy or Test and click on OK - that should create & open a blank catalog
    Brian

  • I need help getting itunes on my new computer. old one crashed

    My old computer crashed, I downloaded iTunes on my new computer and need help getting all of my stuff on it that I had. I did 'home share' to see if that worked, and it didnt.
    Also, on my old computer, when I synced my iPad & my husbands iPod, it didnt sync any music or podcasts, no videos-and i went through each category seperately to sync it and it didnt work. So I can't sync my devices to the new iTunes bc not everything is on there that i have purchased.

    It has always been very basic to always maintain a backup copy of your comuter for just this occasion.  Use your backup copy to put everything on the new computer.
    If for some reason you have failed to maintain a backup, not good, then you can redownload some itunes purchases in some countries:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Need help getting Adobe OnLocation CS3 to work with windows 7 64 bit. Any ideas?

    Need help getting Adobe OnLocation CS3 to work with windows 7 64 bit.  The program installed ok and the S/N took.
    The program does record video and audio HDV M2T.
    The problem is video doesn't display or play back on the monitor component @ 16:9 or 720 p.  4:3....
    The scopes respond as do the audio components when recording. (with a blank monitor component).
    The video does play back on my system no problem.
    Any ideas?
    Dan

    Moving the discussion to OnLocation
    Thanks,
    Atul Saini

  • Need help getting from 10.5.8 to 10.6.

    need help getting from 10.5.8 to 10.6.  i know i'm late to the game!

    If you are not sure of what you are doing,If you are worried about losing anything when doing a major systems upgrade/update,
    Before embarking on a major OS upgrade, it would be wise, advisable and very prudent if you backup your current system to an external connected and Mac formatted Flash drive OR externally connected USB, Thunderbolt or FireWire 800, Mac formatted hard drive. Then, use either OS X Time Machine app to backup your entire system to the external drive OR purchase, install and use a data cloning app, like CarbonCopyCloner or SuperDuper, to make an exact and bootable copy (clone) of your entire Mac's internal hard drive. This step is really needed in case something goes wrong with the install of the new OS or you simply do not like the new OS, you have a very easy way/procedure to return your Mac to its former working state.
    Older version of CarbonCopyCloner found here.
    http://mac.filehorse.com/download-carbon-copy-cloner/2734/
    Older versions of SuperDuper can be found on the SuperDuper Website and Homepage.
    http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html
    Then, determine if your Mac meets ALL minimum system install requirements.
    Mac OS X v10.6 Snow Leopard system requirements
    Purchased Installer disc here.
    http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
    To install Snow Leopard for the first time, you must have a Mac with:
    An Intel processor
    An internal or external DVD drive, or DVD or CD Sharing
    At least 1 GB of RAM (additional RAM is recommended)
    A built-in display or a display connected to an Apple-supplied video card supported by your computer
    At least 5 GB of disk space available, or 7 GB of disk space if you install the developer tools.
    In addition, see this discussion for more relevant info that you may need if you have any other questions or issues.
    Snow Leopard upgrade - keeps Photoshop?

  • Need help getting YTD total

    I've got a period to date report with following columns:
    week1 tots, week2 tots, week3 tots, week4 tots, week5 tot, period-to-date tots, year-to-date tots
    I have a SELECT statement which totals data for the entire year and separates current period totals
    by grouping on the week_nbr . Any date between beginning of year and the end of the previous period will be week 0
    The Select statement retursn 6 rows: 1 for each week in period and one with week_nbr = 0 which represents the totals from the beginning of year
    to the end of the previous period.
    the select statement returns the data correctly . I need help getting the YTD total for (weeks 1 - 5) + (totals for week 0) for each column.
    This means that I will have a 7th record containing the YTD totals. ( I am not concerned with the PTD totals)
    I tried sum by partition but complex decode statement gave me problems.
      CREATE TABLE PERIOD_DATA
       (     "HOT_DOG_STAND_ID" NUMBER NOT NULL ENABLE,
         "WEEK_DATE" DATE,
         "NET_SALES2" NUMBER,
         "BUNS24434" NUMBER,
         "PICKELS_AW38" NUMBER,
         "MUSTARD_TB56" NUMBER,
         "CHICKENHEADS33" NUMBER,
         "PIECES_SOLD34" NUMBER,
         "SCRAPS35" NUMBER,
         "PIECES_UNACCOUNTED" NUMBER
    REM INSERTING into PERIOD_DATA
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('29-DEC-08','DD-MON-RR HH.MI.SSXFF AM'),14301.39,13951.26,3431.13,0,3680,2484,378,818);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('05-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),14651.37,14651.37,3249.55,0,3200,2419,505,276);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('12-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),14169.89,14169.89,2463.53,0,3136,2080,474,582);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('19-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),15864.46,15864.46,3245.49,0,3472,2764,475,233);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('26-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),15961.2,15916.23,3395.51,0,3648,2838,392,418);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('02-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),19066.4,19066.4,4165.07,0,4336,3682,333,321);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('09-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18415.74,18415.74,4024.74,0,4032,3365,482,185);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('16-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18014,17849,3486.33,0,3840,3238,374,228);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('23-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18671.09,18626.12,3729.42,0,3888,2970,353,565);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('02-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),17636,17636,3815,0,3424,2840,490,94);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('09-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),17235.52,17145.58,3897.42,0,3504,2928,421,155);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('16-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),15989.27,15989.27,3372.95,0,3728,3051,369,308);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('23-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),19067.69,18960.41,4152.6,0,4048,3293,442,313);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('30-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),18717.99,18717.99,3923.69,0,4408,3219,593,596);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('06-APR-09','DD-MON-RR HH.MI.SSXFF AM'),17335.16,17335.16,3769.08,0,3928,2997,514,417);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('13-APR-09','DD-MON-RR HH.MI.SSXFF AM'),18967.39,18967.39,4157.76,0,4144,2991,527,626);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('20-APR-09','DD-MON-RR HH.MI.SSXFF AM'),23090.88,23090.88,4427.96,0,5544,4493,560,491);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('27-APR-09','DD-MON-RR HH.MI.SSXFF AM'),24197.98,24132.99,4248.66,0,6680,5190,606,884);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('04-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),20202.21,20137.22,3714.68,0,7052,6170,422,460);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('11-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),18514.48,18514.48,3266.06,0,5508,4178,571,759);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('18-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),18678.68,18678.68,3814.07,0,5824,4345,633,846);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('25-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),17937.18,17937.18,3051.52,0,4844,4986,529,-671);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('01-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17445.75,17445.75,3079.91,0,5028,4810,656,-438);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('08-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17327.88,17327.88,3263.29,0,6112,4674,672,766);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('15-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17241.72,16937.33,3328.27,0,5792,4490,567,735);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('22-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),16625.83,16625.83,3485.18,0,5408,4319,761,328);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('29-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17002.84,17002.84,3091.09,0,5664,4369,544,751);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('06-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),16339.19,16274.2,3075.3,0,4784,3440,697,647);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('13-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),17165.12,16885.14,3458.03,0,4320,3296,640,384);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('20-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),17029.77,16899.79,3198.91,0,4448,3449,645,354);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('27-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),16596.89,16596.89,3015.54,0,4624,3288,665,671);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('03-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),16468.58,16468.58,2981.35,0,2224,3495,564,-1835);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('10-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),18625.48,18550.5,3524.44,0,4856,3482,578,796);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('17-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),24538.54,24323.55,5580.71,0,5260,3771,608,881);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('24-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),18081.37,18081.37,3533.45,0,5980,3080,553,2347);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('31-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),17183.25,17183.25,3487.12,0,2544,3262,615,-1333);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('07-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),17688.41,17575.29,3424.17,0,4800,3480,591,729);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('14-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),18211.29,18211.29,3806.32,0,3968,3104,527,337);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('21-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),16809.21,16744.22,3014.61,0,4128,3124,710,294);
    SELECT HOT_DOG_STAND_ID
    , DECODE(TRUNC(week_date , 'iw') ,
             to_date('24-AUG-09' , 'dd-mon-rr') , 1 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 , 0) AS week_nbr
    , SUM(NET_SALES2)                                                                                                                                                                                                                                                     AS net_sales2
    , SUM(BUNS24434 ) BUNS24434
    , SUM(PICKELS_AW38) PICKELS_AW38
    , SUM(MUSTARD_TB56) MUSTARD_TB56
    , SUM(CHICKENHEADS33) CHICKENHEADS33
    , SUM(PIECES_SOLD34) PIECES_SOLD34
    , SUM(SCRAPS35) SCRAPS35
    , SUM(PIECES_UNACCOUNTED) * - 1 PIECES_UNACCOUNTED
       /*--== Head average  net_sales / chickenusage*/
    , CASE
          WHEN NVL( SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND(SUM(net_sales2) / ( SUM(ChickenHeads33) / 8 ) , 2)
       END AS Head_average
       /*--=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100*/
    , CASE
          WHEN NVL(SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND((((SUM(ChickenHeads33) / 8 ) - ( SUM(scraps35) / 8 ) - (SUM(pieces_unaccounted) / 8 )) / (SUM(ChickenHeads33) / 8 )) * 100 , 2)
       END AS efficiency
    FROM period_data per
    WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IY') AND TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IW') + 6 + 7 * 4
    GROUP BY hot_dog_stand_id
    , DECODE(TRUNC(week_date , 'iw') ,
          to_date('24-AUG-09' , 'dd-mon-rr') , 1 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 ,
          0)
    ORDER BY DECODE(TRUNC(week_date , 'iw') , to_date('24-AUG-09' , 'dd-mon-rr') , 1 , to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 , to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 , to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 , to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 , 0);The expected results will be:
    HOT_DOG_STAND_ID       WEEK_NBR               NET_SALES2             BUNS24434              PICKELS_AW38           MUSTARD_TB56           CHICKENHEADS33         PIECES_SOLD34          SCRAPS35               PIECES_UNACCOUNTED     HEAD_AVERAGE           EFFICIENCY            
    141                    7                      697067.09              694887.4               139149.91              0                      175808                 139454                 21036                  15318                  31.72                  79.32                  You can get these dame results by running endpot-to-endpoint query:
    SELECT  HOT_DOG_STAND_ID
         , max(7) as week_nbr
         ,sum(NET_SALES2)      net_sales2
          ,sum(BUNS24434 )        BUNS24434
          ,sum(PICKELS_AW38)      PICKELS_AW38
          ,sum(MUSTARD_TB56)     MUSTARD_TB56
          ,sum(CHICKENHEADS33)   CHICKENHEADS33
          ,sum(PIECES_SOLD34)    PIECES_SOLD34
          ,sum(SCRAPS35)         SCRAPS35
          ,sum(PIECES_UNACCOUNTED)   PIECES_UNACCOUNTED
        ---===== Copied code from outer query
              --==  net_sales / chickenusage 
                      ,   CASE
                             WHEN NVL( sum(ChickenHeads33) / 8    ,0)  = 0 then 0
                             ELSE ROUND(sum(net_sales2)/   ( sum(ChickenHeads33) / 8    ) , 2)
                          END as Head_average
                        --=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100
                        ,   CASE
                                  WHEN NVL(sum(ChickenHeads33) / 8    ,0)  = 0 then 0
                                  ELSE   ROUND((((sum(ChickenHeads33) / 8 )  - ( sum(scraps35) / 8 ) - (sum(pieces_unaccounted) / 8 )) / (sum(ChickenHeads33) / 8 )) * 100, 2)
                          END as efficiency  
    from period_data
    WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' ,'DD-MON-YY'), 'IY') AND TO_DATE( '27-sep-09' ,'DD-MON-YY')
    group by hot_dog_stand_id;Thanks In Advance

    Hi,
    Welcome to the forum!
    Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful. You could teach something to some people who have been using this forum for years (except that nobody can teach them).
    user12335325 wrote:
    The expected results will be:
    HOT_DOG_STAND_ID       WEEK_NBR               NET_SALES2             BUNS24434              PICKELS_AW38           MUSTARD_TB56           CHICKENHEADS33         PIECES_SOLD34          SCRAPS35               PIECES_UNACCOUNTED     HEAD_AVERAGE           EFFICIENCY            
    141                    7                      697067.09              694887.4               139149.91              0                      175808                 139454                 21036                  15318                  31.72                  79.32                 
    Do you mean the expected results will include the row above, and that the results will be this row along with the 6 rows you're already getting? (If you wanted just that one row, I suppose you would just run your second query.)
    That sound like a job for ROLLUP.
    VARIABLE   start_date     VARCHAR2 (11);
    EXEC         :start_date  := '24-AUG-2009';
         SELECT  HOT_DOG_STAND_ID
         ,      NVL (CASE
                   WHEN  week_date >= TO_DATE( :start_date, 'DD-MON-YYYY')
                   AND   week_date <  TO_DATE( :start_date, 'DD-MON-YYYY') + 35
                   THEN  1 + FLOOR ( (week_date - TO_DATE( :start_date, 'DD-MON-YYYY'))
                                             / 7
                   ELSE  0
                      END
                 , 7
                 )          AS week_nbr
    , SUM(NET_SALES2)                                                                                                                                                                                                                                                     AS net_sales2
    , SUM(BUNS24434 ) BUNS24434
    , SUM(PICKELS_AW38) PICKELS_AW38
    , SUM(MUSTARD_TB56) MUSTARD_TB56
    , SUM(CHICKENHEADS33) CHICKENHEADS33
    , SUM(PIECES_SOLD34) PIECES_SOLD34
    , SUM(SCRAPS35) SCRAPS35
    , SUM(PIECES_UNACCOUNTED) * - 1 PIECES_UNACCOUNTED
       /*--== Head average  net_sales / chickenusage*/
    , CASE
          WHEN NVL( SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND(SUM(net_sales2) / ( SUM(ChickenHeads33) / 8 ) , 2)
       END AS Head_average
       /*--=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100*/
    , CASE
          WHEN NVL(SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND((((SUM(ChickenHeads33) / 8 ) - ( SUM(scraps35) / 8 ) - (SUM(pieces_unaccounted) / 8 )) / (SUM(ChickenHeads33) / 8 )) * 100 , 2)
       END AS efficiency
    FROM period_data per
    WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IY') AND TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IW') + 6 + 7 * 4
    GROUP BY  hot_dog_stand_id
    ,           ROLLUP (
                 CASE
                   WHEN  week_date >= TO_DATE( :start_date, 'DD-MON-YYYY')
                   AND   week_date <  TO_DATE( :start_date, 'DD-MON-YYYY') + 35
                   THEN  1 + FLOOR ( (week_date - TO_DATE( :start_date, 'DD-MON-YYYY'))
                                             / 7
                   ELSE  0
                 END          -- week_nbr
    ORDER BY  week_nbr
    ;Notice I simplified the computation of week_nbr.
    Some other people have asked questions about hot dog stands recently.
    I'm curious; is this from a course? If so, where? What is the textbook (if any)?
    Thanks.

  • Problem with a simple RMI program

    I'm trying to get a simple RMI program to work, by following the instructions in this link:
    http://developer.java.sun.com/developer/technicalArticles/RMI/CreatingApps/index.html#dro
    When it gets to this line:
    Lookup look_obj = (Lookup)Naming.lookup(name);this exception is generated:
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    What's wrong, eh?

    Canadian, eh?
    Looks like your security settings on you computer are set to not allow a socket connection.
    Specifically is is saying that access to port 1099 on your local machine (127.0.0.1 is the loopback address) is being denied.
    There are two main reasons this could happen (off the top of my head), though someone else might know from the message exaclty which one.
    1. Your java security permissions do not allow an out going socket connection (are you writing an applet?)
    2. Your computer protects access to port 1099.

  • TS1538 i need help because i need help getting my ipod touch to connect to windows vista and

    i need help getting my ipod touch to connect to windows because it keeps saying udb device not recognized and i tr\]ied restarting the settings!!!!!

    Have you tried here:
    iOS: Device not recognized in iTunes for Windows

  • TS4268 I need help getting my face time and imessage to work.

    I need help getting my face time and imessage to work. It is saying wating for activation. I just got my iphone 5 2 days ago. I have reset it from the phone and from itunes on the computer, made sure I'm attached to wifi.

    The 3 basic troubleshooting steps are these in order: 1. Restart your iphone  2.  Reset your settings/iphone  3.  Restore your iphone.  Since your iphone is only a couple of days old, you should backup your device before restoring.  If you don't have anything on your iphone that you care to lose, then simply restoring without a backup is fine.  A quick reset of pressing the sleep/wake button (top of iphone) and your home button simultaneously and holding it until the silver Apple logo appears. 

  • I need help getting my OS X Mavricks download to work and start downloading but it wont work

    i need help getting my OS X Mavricks download to work and start downloading but it wont work

    Contact http://www.apple.com/support/mac/app-store/contact/. They're responsible for getting this abysmal delivery system to work.

  • I need help getting my os x mountain lion to work for my pro tools

    I need help getting my os x mountain lion to work for my pro tools

    Since you provide no details I can do nothing but guess, so perhaps this will help:
    http://avid.force.com/pkb/articles/en_US/how_to/Upgrading-to-Mac-OS-10-8?popup=t rue&NewLang=en&DocType=1080
    http://avid.force.com/pkb/articles/en_US/compatibility/Avid-Software-and-Mac-OS- X-10-8?popup=true&NewLang=en&DocType=1083
    If you continue to have problems, you probably should contact Avid support.
    Regards.

Maybe you are looking for

  • How to edit text inserted into a gif

    I have a gif image.  I opened the image.  I insert text the with horizontal text tool. After inserting I can move the text around, but I can't edit the text, can't add or change characters, can't change color. Is there a way to do that?

  • Can you put a link in a Slideshow for muse?

    I'm making my images for my muse homepage main slideshow in photoshop. How can I create a link on a slideshow image, without it appearing on top of all the other pictures through the slideshow? Thankyou, KM

  • [SOLVED]Extra keyboard key to eject cd/dvd

    Hi, Every my extra key (what i needed) are working. Problem is only with ejecting CD. I have added to my openbox rc.xml file : <keybind key="XF86Eject"> <action name="Execute"> <execute>sudo eject -r /dev/sr0</execute> </action> </keybind> <keybind k

  • Upgrade MultiOrg 10.7 on Tru64 for 400-800 conc users

    I have 8 HP-UX 10.20 servers with Apps 10.7 (no MultiOrg) & RDBMS 7.3.3.x, I am planning to migrate them ?? to one HP Tru64 server with MultiOrg 10.7 & RDBMS 7.3.4 with 400-800 concurrent users. My idea is to set 8 different organizations in my Multi

  • Can I use Web Connector(Proxy) by file extension?

    Hi, All~ As you know, we can use proxy by ppath or extension in WebLogic like below. How can I configure NWS 4.1 obj.conf, so that web connector can catch all jsp files for iAS6. <Object name="si" ppath="*/servletimages/*">Service fn=wl-proxy WebLogi