Simple calculation problem...pls help

i have 2 report blocks in my report.
the query for report block 1 is
select emp_name,sal sal1 from emptable where emp_num=7167
the query for the next report block is
select emp_name,sal sal2 from emptable where emp_num=7168
both the reports query the same table and get the same number of records.
i want the difference of sal1-sal2...
how do i do it..
pls help....

You could do salary diff calculation in a pl/sql function, and create the ref cursor query based on the function.
Thanks,
-Shaun

Similar Messages

  • Calculation problem. pls help

    hi all, i am really very new to Java programming.
    And really got stuck with this program. I am not asking or expecting anybody to help me to do my assigment.
    This I understand.
    But how to add in the calculation part. I am really stuck.
    Request:
    Proctor and Gambol is a manufacturing organization. It has many plants and machineries, which run right around the clock. It has a work force of 200 production operators. The operators are paid based on the ?hourly rate?. Most of them work on shifts; there are three shifts to fit in the operators. Each shift has different rate of payment and rate differs on the grades of employee.
    Any employee working for more than 45 hours are paid based on an overtime rate.
    Analysis of the Request:
    To development a Java program to calculate the payment for employees based on the following factors:
    1. Grade of employees (senior, junior, new and temporary.)
    2. Shift worked (hourly rate for shift 1,2 and 3)
    3. Working hrs.
    4. Overtime rate (if total hrs worked in a week > 45hrs)
    Data to be input for calculation:
    1. Employee number (0 to 200)
    2. Grade of Employee (S,J,N or T)
    3. Shift number (1,2 or 3)
    4. Hours worked (>45 hrs are based on overtime rate)
    Data or Information required for calculation:
    1. Employee grade (S/J/N/T)
    2. Employee shift levels (1/2/3)
    3. Normal shift rate
    4. Overtime shift rate (>45 hrs per week = 1.5 times Normal shift rate)
    5. Standard working hours at 0 to 45 hours per week
    6. Maximum working hours at 99 hours per week
    Expected Output of the program:
    1. Employee number
    2. Employee grade
    3. Shift worked
    4. Total hours worked in the week
    5. Wage payable
    6. Options to Continue another query or Quit the program.
    Design:
    Calculation of the wage payable is as follows:
    Normal Wage = 45 hrs @ normal rate, based on Grade and shift worked.
    Overtime Wage = (Total hours worked ? 45 hrs) * normal rate, based on Grade and shift
    Worked.
    Brief flow of the program is as follow:
    1. Start of the program.
    2. Enter the Employee number. (001 to 200, with a max of 999)
    3. Enter the Grade of Employee.
    4. Enter the Shift worked.
    5. Enter the Total hours worked.
    6. Program will then calculate Wages payable based on Grade of employee, shift worked and total hours worked per week.
    7. Program will display the Wage payable on screen.
    8. Program will then provide options for user to Continue or to Quit.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class Testprogram extends Applet implements ActionListener
    Label screena = new Label (" Proctor and Gambol Co Ltd");
    Label screenb = new Label (" ");
    Label screen1 = new Label ("Enter Employee Number");
    TextField empnum = new TextField(1);
    Label screenc = new Label (" ");
    Label screen2 = new Label ("Click on Employee's Grade");
    Button Senior = new Button("Senior");
    Button Junior = new Button("Junior");
    Button New = new Button("New");
    Button Temporary = new Button("Temporary");
    Label screen3 = new Label ("Click on Shift Number");
    Button Shift1 = new Button("1");
    Button Shift2 = new Button("2");
    Button Shift3 = new Button("3");
    Label screen4 = new Label ("Enter hour worked");
    TextField hours = new TextField(1);
    Label screen5 = new Label ("Enter rate");
    TextField rate = new TextField(1);
    TextField grossPay = new TextField(10);
    Button WagePayable = new Button("Wage Payable");
    public void init()
    add(screena);
    add(screenb);
    add(screen1);
    add(empnum);
    add(screenc);
    add(screen2);
    add(Senior);
    add(Junior);
    add(New);
    add(Temporary);
    add(screen3);
    add(Shift1);
    add(Shift2);
    add(Shift3);
    add(screen4);
    add(hours);
    add(screen5);
    add (rate);
    add(grossPay);
    add(WagePayable);
    WagePayable.addActionListener(this);
    Senior.addActionListener(this);
    public void actionPerformed(ActionEvent e)
    if(e.getSource()==Senior)
    double x = Double.valueOf(rate.getText
    ()).doubleValue();
    double y = Double.valueOf(hours.getText
    ()).doubleValue();
    double gross = x + y;
    grossPay.setText(""+gross);

    Hello,
    Model each employee as an object - and thus you need a class Employee to initialize these, for example (please note that I have not tested it - nor compiled it):
    * This class represents an employee.
    public class Employee{
       private int employeeNumber;
       private String employeeGrade;
       private int shiftNumber;
       public Employee( int e, String g, int s){
          employeeNumber = e;
          employeeGrade = g;
          employeeShiftNumber = s;
       public int getNumber( ){
          return employeeNumber;
       public String getGrade( ){
          return employeeGrade;
       public int getShift( ){
          return employeeSiftNumber;
    }Now you can write a small test program (this is just the method which calculates the pay and not the whole program). The method is below:
    * This method calculates the pay for an employee.
    public void paymentDue( Employee e, int hoursWorked){
       double payRate = 0.00;
       double pay = 0.00;
       double overTime = 0.00;
        * Obtain the payRate for this employee.
       if( e.getGrade( ) == t) payRate = 1.00;
       else if( e.getGrade( ) == n) payRate = 2.00;
       else if( e.getGrade( ) == j) payRate = 3.00;
       else if( e.getGrade( ) == s) payRate = 4.00;
        * Obtain the shift for this employee.
       if( e.getShift( ) == 1) payRate = payRate + 0.50;
       else if( e.getShift( ) == 2) payRate = payRate + 1.00;
       else if( e.getShift( ) == 3) payRate = payRate + 1.50;
        * Calculate the pay for this employee.
       if( hoursWorked <= 45)
           pay = hoursWorked * payRate;
       else{
           overTime = ( hoursWorked - 45) * ( payRate * 1.5);
           pay = 45 * payRate + overTime;
        * Print out the information for this employee.
       System.out.prinln( "Employee number: " + e.getNumber( ));
       System.out.prinln( "Employee grade: " + e.getGrade( ));
       System.out.prinln( "Shift worked: " + e.getShift( ));
       System.out.prinln( "Hours worked: " + hoursWorked);
       System.out.prinln( "Wage payable: " + pay);
    }This method can be called for example, with the call:
    paymentDue( new Employee( 20, j, 1), 47);I hope this helps - please ask if you need any more points.
    Best regards
    -marek.

  • Urgent: Sessions problem pls help me

    Hi all,
    Its already late to post this problem.pls help me urgently.
    I have a servlet & two jsp's. first i request servlet, it processes something and forwards request to my first jsp. In that jsp on a button click, i'm displaying a new popup by calling showModalDialog. this dialog gets data from the same servlet but it forwards to my second jsp.(second jsp can be seen in dialog)
    Now if i submit form from my second(dialog) jsp, the servlet reports that session has expired. I tried a lot but invain. any one who helps me is appreciated well by all of our forum.
    waiting 4 u r reply,

    It could be that you have cookies turned off and you're not using URL Rewriting.
    In J2EE, the first time your browser makes a request to the server, the server responds and appends a SESSION_ID parameter to the request as well as storing a cookie with the SESSION_ID.
    The second time your browser makes a request, the server checks for the cookie. If it doesn't exist it checks for the parameter. If neither exist the server assumes its the first time your browser has made a request and behaves as describe in the previous paragraph.
    In your case when you submit the form if you have disabled cookies and the action attribute doesn't have the SESSION_ID paramter appended to the url, the browser will assume it's a first request. The user will not be logged in, hence your session has expired error.
    To fix this you need to encode the URL in your JSP. You can use the struts html:rewrite tag or the HttpServletReponse.encodeURL method, or if you're using JSP 2.0 the JSTL c:url tag.

  • Boot problem == pls HELP

    I have use the utility disk and format the machintos drive , and use  Extended (Journaled , Encrypted) , it ask me for a password (typed the password, confirmed the password - done) ,  after that i tried to install a fresh copy of Lion (i waited to be downloded from apple.com - done) after that it said that the fresh copy it will be installed and it will reboot by itself -> done ... from here the problem it's starting .... now my macbook air , it dosent start anymore it keep showming me, instaid of the apple sign from the start , a sign like the one from ghost busters (but without the ghost in it ) , i have tried to boot from cd , from usb , nothing dosent seams to be working.
    If anyone know a solution to this problem, pls HELP! Thank you in advance...
    p.s. before i had 2 hard drives that show up when i press the ALT button (machintos hd and utility drive, or something like that) now.. the only thing that it's showing me is : mac os base system , and if i try to use partition magic or something else, from a usb, it will tell me something about a bootguard , but i don't know how to insert the password.

    Glad your issue is fixed. Thanks for the update!
    Click if you want to Thank someone. If Problem is resolved, so that others can make use of it.

  • How to solve this problem, pls help when I try to see remote camera system from home."Dual streaming is required for HTML viewing"

    How to solve this problem, pls help when, I try to see remote camera system(spec dvr) from home. The Error I get is "Dual streaming is required for HTML viewing"

    I had the same probelm and found that the problem lies with 64bit programs such as safari and microsoft internet explorer. I have resolved the issue on my PC based server by using a 32 bit ie and same on my mac by using the same running windows under parallels.
    So far the problem with the 64 bit side of it is still to be resolved.
    Hope this helps and gets you guys up and running until suchtime a 64 bit solution is found.
    Craig

  • Simple OOP Problem. Help!

    This is just a simple OOP problem that i cant decide on a best
    implementation for.
    im passing an object to an instance of, 'TabbedFrame', which is just
    a frame with a Tabbed Pane in it that is holding custom panels.
    however, these custom panels need access to the object being
    passed to 'TabbedFrame' and to some methods in it.
    i cant make them static however so how do i gain access to them?
    is my only option to pass the 'TabbedFrame' to each panel?
    like - jtabbedpane.add( "Panel 1", new mypanel1(this));
    here is code:
    new TabbedFrame( DataObject );
    public class TabbedFrame{
    public TabbedFrame(DataObject do){
    this.do = do;
    jtabbedpane.add( "Panel 1", new mypanel1() );
    DataObject do;
    public class mypanel1{
    public mypanel1(){
    // need access to DataObject of the 'TabbedFrame' object that instantiated
    // this 'mypanel1' and to some of its methods
    }i would just pass the DataObject to evey panel (there are 12) but
    i also need to be able to call methods in the 'TabbedFrame'.
    Any help would be appreciated!

    Modify mypanel1's constructor:
    public class mypanel1{
    TabbedFrame tf;
    public mypanel1(TabbedFrame tf){
    this.tf = tf;
    // need access to DataObject of the 'TabbedFrame' object that instantiated
    // this 'mypanel1' and to some of its methods
    DataObject theDo = tf.getDataObject();
    tf.someMethod(); // Call method on the TabbedFrame
    }In TabbedFrame:
    public TabbedFrame(DataObject do){
    this.do = do;
    // Modify call to constructor to pass "this" TabbedFrame.
    jtabbedpane.add( "Panel 1", new mypanel1(this) );
    }

  • Import problem,pls help!

    Hi,there,
    I'm new guy here,I'v got a problem about Import in table mode,I found I can import back all records successfully, but it just appends all records into the orignal table,not overwrite
    it,for example, I made a export for a table with 2 records, after then I added some records into that table,
    finally I made an import for that table, I found the
    total of records is not recovered to 2,but just append
    the records from export file,why can't I recover it to 2
    record? pls help me,thanks!

    All that import does is to run a bunch of SQL statements based on the content of the export file. If you look at the export file in an editor (if its small), or through type (on Windoze) or more on *NIX you will see stuff like:
    CREATE TABLE x STORAGE ( ...)
    INSERT INTO x col12,col2, ...
    VALUES (:b1,:b2, ...
    If you give imp the paramter ignore=Y, then the error generated by the CREATE TABLE (table already exists) will be suppressed, but the ata will be inserted. Note that there are no DROP TABLE or TRUNCATE TABLE commands in the export file.
    If you want to restore your database to a particular point in time using import, then you will need to manually drop or truncate the tables first. You can generate the required sql from the data dictionary. something like
    SET lines 1000 pages 0 feedback off trimspool on;
    SPOOL drop.sql;
    SELECT 'DROP TABLE '||table_name||';'
    FROM user_tables;
    SPOOL OFF;
    @drop.sqlHTH
    John

  • Weird Problem pls help.

    Hi guys I have a big problem that I can't figure out. See I have a PT880 Neo and on the mobo box it says it's VIA. But when I go to install the Hyperion 4 in 1 mobo drivers my system crashes. When I boot up I get a Bsod stating my graphics card is in an infinite loop and says the video driver for my card is the problem. Also when I go to install new hardware it doesn't detect it. I checked the bios and pnp is enabled. So I put a new network card in and it will only detect it in the top pci slot so is this some kind of glitch am I downloaded the right drivers? The hyperion 4 in 1's version 455vp1 pls help

    I need your full system specs + PSU specs.
    Read these guides as well >Moan Guide Power Supply Guide

  • Upgradation problem pls help

    I imported my oracle 8.1.5 database dump in oracle 8.1.7 but when I want to connect to my instance thru a client machine one error message comes as "
    problem in connecting to the database, check whether it is started or contact sys admin" whereas the database is in open state.
    Then when I connected to sqlplus at the server, it gets connected but some messages also come as below"
    ORA-06553: PLS-213: package STANDARD not accessible
    Error accessing package DBMS_APPLICATION_INFO
    ERROR:
    ORA-06553: PLS-213: package STANDARD not accessible
    Could anyone pls help..

    What is the result of
    SQL> show parameter PLSQL_V2_COMPATIBILITY
    ?

  • Serious problem. pls help !!!!!!!!!

    some "khar, khar sound is coming from below of the keyboard of my hp g6 pavillion 2231 all the time when the lapton is on. what to do. i am fed off of that noise. pls help!!!!!!!!
    This question was solved.
    View Solution.

    Hi 
         Sorry khar khar ????   Mainly any sounds from under the keyboard would be Fan or HDD either way could mean either the Fan ( if fan ) is struggling to move due to dust build up OR the hard drive is failing  ,,, It's difficult to give you a firm answer without more information . Can you tell the difference between the fan noise and a hard drive noise ?? When you start up from cold does the noise start immedietly or is it only heard after say 5-10 minutes ??????           Checkurtech
    ****Click the White Kudos star to say thanks****
    ****Please mark Accept As Solution if it solves your problem****

  • Installation problem, pls help

    I am trying to install Oracle 10g on SUSE 10.0.0 but when i run the ./runInstaller command, I receive an[b] error of writting to directory /tmp/OraInstall2006-03........, Please ensure this directory is writable and at least 60MB of disk space, i have checked for space using df -h /tmp, there is enough space, i think the problem has got to do with permission because @ the moment it belongs to root user, i don't know what to do, i am a novice to unix and need to install oracle today. Pls help
    Usually the standard install of SuSE Linux should set the ownership and access rights to /tmp, if you want to give access to everyone on the system, just use this command (if owner/root access is available):
    I have used chmod o+rwx /tmp command and still having the same error. Pls somebody help
    chmod o+rwx /tmp

    Of course I assume you did correctly follow installation and configuration instructions. Did you read Oracle10g/Linux Errors and Problems from Werner Puschitz ?

  • Audio+Video Chat works but one small problem.Pls help.

    HI..
    as i had posted once before in a different query's thread, i have implemented audio and video chat using AVTRansmit2 and avreceive2.
    audio and video chat work well.By video chat i mean not only video but VIDEO+AUDIO as well.. just like usual yahoo video chat.
    But the problem is like this:-=
    I have given an option for user to switch from audio chat to video chat.
    now if a user first goes to audio chat and then switched to video chat,
    then the problem comes. When he's shifted to video chat i close down previous Audio chat by RTPManager.dispose() , i close the player and everything..
    and then i start Video transmit/receive "ALONG WITH" audio transmit/receive..
    No this time video starts but audio doesnt work ..
    it says"waiting for rtp data to arrive.... "
    The problem is that when this new stream of audio data comes, the receiver somehow thinks that its the same old stream since its from same transmitter IP.. and so it tries to UPDATE the previous stream.
    It means there is some problem with the close method or RTPManager.dispose() which should have disposed off all the stuff much before the new connection was made.
    PLS HELP ASAP>
    this is crunch time for my project.

    Hi anandreyvk . .
    well, i had tried doing removetargets and also, i had disposed RTPManager well. As it turns out the problem was not with any of it but it was the problem of me incorrectly passing RTPManager from AVReceive2 to AVTransmit2.
    Actually i am using just one RTPManager.. since i am receiving and transmitting on the same port.
    i've solved the problem but i am not sure if this is the right way .. what do you think ??
    is creating just one RTPManager {by that,i mean initializing it only once} a good idea ?? Since we are supposed to call both AVTransmit2 and AVReceive2 with the "LOCAL PORT" .. {which in itself is a matter of discussion though! } i and my project mate thought initializing RTPManager only once is a better option .
    Whats your take on all of this ?

  • Help me out  to resolve a conditional problem----pls help

    Hi Experts ,
    I have the requirement in which if the apinumber is greater than or equal to 10 then only the rows should get inserted into the well_header_table from products_mv table.I need to use only merge concept and nothing else.
    I am making use of the merge concept here .I am checking for the 10 digit condition during the updation part but same will be inserted into the well header table.This shouldnt happen .Can any one suggest me how can i filter out the insertion part so that it only inserts the rows which has api_number greater than 10 digits.I have marked my 10 digit condition that checks for the update part in bold form.
    Pls help me out in resolving this issue .
    regards
    debashis
    [\n]
    CREATE or REPLACE PROCEDURE NAG.MERGE AS
    BEGIN
    merge into NAG.Well_Header_Table
    using nag.products_mv
    on (SUBSTR(nag.products_mv.API_NUM,0,10) = SUBSTR(NAG.Well_Header_Table.API_NUMBER,0,10) )
    WHEN MATCHED THEN UPDATE SET
    NAG.Well_Header_Table.WELL_NAME = nags.products_mv.WELL_NAME where nag.products_mv.API_NUM >= 999999999
    WHEN NOT MATCHED THEN INSERT (NAG.Well_Header_Table.API_NUMBER,NAG.Well_Header_Table.WELL_NAME,NAG.Well_Header_Table.SECTION,NAG.Well_Header_Table.TOWNSHIP,NAG.Well_Header_Table.RANGE,NAG.Well_Header_Table.WELL_METER_NUMBER,NAG.Well_Header_Table.COUNTY_NAME,NAG.Well_Header_Table.OPERATOR_NAME,NAG.Well_Header_Table.PRODUCTION_FORMATION,NAG.Well_Header_Table.STATE_NAME,NAG.Well_Header_Table.FIELD_NAME,NAG.Well_Header_Table.WELL_FLAC_NUMBER,NAG.Well_Header_Table.WELL_LEASE_FLAC,NAG.Well_Header_Table.WELL_TYPE,NAG.Well_Header_Table.WELLBORE_PROFILE,NAG.Well_Header_Table.STATUS)
    values (nag.products_mv.API_NUM,upper(nag.products_mv.WELL_NAME),nag.products_mv.SECTION,nag.products_mv.TOWNSHIP,nag.products_mv.RANGE,nag.products_mv.METER_NUMBER,upper(nag.products_mv.COUNTY_NAME),upper(nag.products_mv.OPERATOR),upper(nag.products_mv.PROD_ZONE),upper(nag.products_mv.STATE_NAME),upper(nag.products_mv.FIELD),nag.products_mv.WELL_FLAC_HZ,nag.products_mv.LEASE_FLAC,upper(nag.products_mv.WELL_TYPE),upper(nag.products_mv.WELLBORE_PROFILE),null);
    END;
    [n]
    regards
    Debashis

    Try those selects below and look at your on condition
    select substr('123456789',1,10) from dual
    select 123456789 from dual where 123456789 > 999999999
    -- perhaps
    on (nag.products_mv.API_NUM = NAG.Well_Header_Table.API_NUMBER and nag.products_mv.API_NUM > 999999999)Regards
    Etbin

  • Im my lap has hard disk problem,how to resolve the problem,pls help me...

    Hello,
               I have hp pavilion dv4 lap,in this lap has some hard disk problem,when i am turn on the lap that screen shows this message "The smart hard disk check has detected an imminent failure.To ensure not data loss,please backup the content immediately and run the hard disk test in system diagnostics".
               After that i was diagnostics the system but no changes in the lap,,again again lap shows hard disk error(301).
               Then i  am chosen the enter option to start up the lap it take long time for openning the windows,after enter the windows that also shows about the hard disk  error in within few minitues,
               What can i do?
               This lap bought at 12-oct-2012 from malasiya,now im in tamil nadu,how to solve the problem please help me.

    Hello srhk. Thank you for posting on the HP Forums.
    I understand the hard disk is experiencing issues. Error 301 indicates the hard disk possesses a hardware defect. I would contact HP Phone Support for assistance, or purchase an equivalent hard disk.
    If you choose to contact HP, their options will be based on the warranty status of the computer. If you do not have this information, you can locate it at this website: http://h20566.www2.hp.com/portal/site/hpsc/public/wc/home?ac.admitted=1384280905804.876444892.199480...
    You can utilize this website to learn how to contact HP appropriately, based on your region: http://www8.hp.com/us/en/contact-hp/ww-contact-us.html
    Please let me know if you have any other questions or concerns.
    Mario
    I worked on behalf of HP.

  • Simple Servlet question, pls help

    This is my form submission part in my jsp page
    <form name="updateForm" method="POST" action="/Update"> This is my web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <servlet-name>/Update</servlet-name>
        <servlet-class>UpdateMap</servlet-class>
      </servlet>
    </web-app>This is my UpdateMap.java
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    public class UpdateMap extends HttpServlet
        public UpdateMap()
    }I put my UpdateMap.class in WEB-INF/classes/ directory but when I clicked the submit button in my jsp page, I got The requested resource (/Update) is not available error

    Found my own error. The jsp submission code should be
    <form name="updateForm" method="POST" action="Update"> But I still got error when submit
    The specified HTTP method is not allowed for the requested resource ( POST method of HTTP is not supported by this URL.)Pls help.
    Thanks

Maybe you are looking for

  • Rendering a Quicktime .mov in CS5 as 16:9 but getting roughly a 4:3

    Basically what it says in the subject line. I'm using basic settings on a PC and here's a screenshot. A friend of mine is having the same trouble and on top of that his sound mix guy, who uses a mac, can't get any sound from the .mov file. Any though

  • MM Planned Freight Costs with

    Dear friend Does anyone could guide me to setting up the  freight costs by condition FRB1 to ECC put the value of condition as part of costs of material ! Could you explain the behavior of MIRO(Accounting posting) with main item together with planned

  • How can I get customer service?

    How can I get costumer service

  • Photo Stream No Longer Functioning on MacBook Pro

    I have laptop, iPhone, and iPad. Photo Stream used to work seamlessly on all 3 devices. Not so now. It works fine between the iPad and iPhone, but it doesn't deliver to my MacBook Pro, or if it does, it is days later. I've tried unticking various box

  • Is it possible to use a CONSTANT as Default Namespace?

    Hi, I create from a table and an XML-field a view. For the command XMLTABLE I have to use a DEFAULT namespace. Is it possible instead of a fixed string to use a constant variable which I read using a function? As example: CREATE OR REPLACE VIEW pain_