Multiplication of the columns in the table and displays the result

Hello Experts!
With the help of Jdeveloper 11 g Release 1:
I have a situation where I have a two tables showing the relationship of the master / detail. Now the main table shows the available quantity and the unit price and will then multiply to show the total price.
The Details table does the same thing but has an additional column (added manually) with another text entry that requires the 'quantity' and then I need the total price with this value as well. So overall, the user has the option to select a quantity that is less than or equal to the quantity available (from the main table) and then to calculate the new total price based on user input.
How can I go about it?
All of the suggestions! ?
s =

I apologize in advance if this does not work for you, but here's my point of view.

(1) add QtyDesired as a transitional editable column with a set of expressions Qty.
(2) make your transitional column TOTALCOST an expression of QtyDesired * UNITPRICE.
(3) according to how your page is set up, your QtyDesired may need to raise a contextual event. Otherwise, it might be enough to assign partial release of your TotalCost your column QtyDesired column to allow a partial page refresh. I do something similar by editing the line of my table in a popup, and then when the dialog box closes, it refreshes the table with the new values.

Hope that helps. Just throwing some ideas out there. AutoSubmit and partial triggers seem to trouble many of my problems of refresh.

Tags: Java

Similar Questions

  • Add Colume in the table and display the result in it.

    Hi guru,.
    I have a requirement to add the column to the existing Table. and display the result after calculation.


    Thank you
    Rutu

    Hello

    Please use this referral code snippet:

    Am = (OAApplicationModule) pageContext.getApplicationModule (webBean) OAApplicationModule;
    OAViewObject vo = (OAViewObject) am.findViewObject (""); Give VO name attached to the region of the Table.
    If (vo! = null)
    {
    vo.addDynamicAttribute (""); Addition of ViewAttribute to VO
    }
    VO. Reset();
    VO. Next();

    Do the math you want to

    Definition of the calculated value in the created attribute of VO
    vo.getCurrentRow () .setAttribute ("", );

    I hope that gives you a proper help.
    Please do not hesitate to ask if more Question

    --
    Thank you
    Shrikant

  • Oracle how to multiply two columns of different tables and results

    Oracle how to multiply two columns of different tables and get the result in the third column?

    I want to multiply all the lines of the quantinty column in the table of quantity with the relevant lines of the table of prices price column and get the result of multiplying in the third column. What should I use procedure trigerr? OR IS IT POSSIBLE HOW TO DO IT PLEASE HELP :D

    Edited by: 994229 2013-03-15 12:44
    /* Formatted on 3/15/2013 3:51:08 PM (QP5 v5.185.11230.41888) */
    CREATE TABLE mytable1
    AS
       (SELECT 1 id, 5 VALUE FROM DUAL
        UNION ALL
        SELECT 2, 7 FROM DUAL
        UNION ALL
        SELECT 3, 8 FROM DUAL);
    
    CREATE TABLE mytable2
    AS
       (SELECT 1 id, 4 VALUE FROM DUAL
        UNION ALL
        SELECT 2, 12 FROM DUAL
        UNION ALL
        SELECT 10, 12 FROM DUAL);
    
      SELECT id,
             mytable1.VALUE,
             mytable2.VALUE,
             mytable1.VALUE * mytable2.VALUE product
        FROM mytable1 FULL OUTER JOIN mytable2 USING (id)
    ORDER BY id;
    
    ID     VALUE     VALUE_1     PRODUCT
    1     5     4     20
    2     7     12     84
    3     8
    10          12     
    
  • Link to information from tables and display the 'best '.

    Hello! I'm totally new to this great software, and the truth is that I lost D:
     
    I try to explain in more detail what I have to do, I hope you can help me please it is urgent T_T

    I do 3 tables must be related to each other, that is to say a table where a username will be manually enter, another where you manually enter the user name and the third which will automatically enter power of each user (for automatic writing, I'll use random data). Each table will have a box number, for example:
     
    Table 1, box 1: Paul
    Table 2, box 1: door
    Table 3, box 1: 3.74
     
    Table 1, box 2: Miguel
    Table 2, box 2: Ramos
    Table 3, zone 2: 4.99
     
    Table 1, box 3: Maelle
    Table 2, area 3: Branco
    Table 3, case 3: 4.98
     
    I mean, I bind the box to one table with the other three. And because the program must compare the data in table 3 (power) and display the data of the user of best (which has the highest power). In this example, the program should appear:
     
    BEST USER:
    NAME: MIGUEL RAMOS
    POWER: 4.99

    (Is not slender record information when I close the program)

    I don't know if I ask you very much, I have a very clear idea in my head of what I have to do, but being a new software for my not know how to implement it.

    Thank you in advance for your quick response and help and ilustrative! xD

    Have you tried something with the basic understanding of your question check if this is what you need?

    -Still not clear what you mean by table? (In my opinion, the table is 2d array of values here, otherwise please let me know.)

    -C' is the reason why I asked you to show your code you did then it will be clearer.

  • Join the 2 tables and display in simple rows

    Hello

    I have 2 tables, clock_in and clock_out as below

    Table: clock_in
    EmpNo, first_in, total_in
    1001, 20-SEP-2012, 3
    1003, 23-SEP-2012, 5

    Table: clock_out
    EmpNo, last_out, total_out
    1001, 21-SEP-2012, 9
    1002, 23-SEP-2012, 8

    I wanted the result as below, so far without success. I tried the full outer join but the never the end running query.
    Hope someone can help me.

    result
    EmpNo, first_in, last_out, total_in, total_out
    1001, 20-SEP-2012, 21-SEP-2012, 3, 9l
    1002, null, 23-SEP-2012, null, 9
    1003, 23-SEP-2012, null, 5, null

    You probably need something like that.

    with clock_in as
    (
    select 1001 id, to_date('20-SEP-2012', 'DD-MON-YYYY') dt, 3 tot from dual union all
    select 1003, to_date('23-SEP-2012', 'DD-MON-YYYY'), 5 from dual
    ),
    clock_out as
    (
    select 1001 id, to_date('21-SEP-2012', 'DD-MON-YYYY') dt, 9 tot from dual union all
    select 1002, to_date('23-SEP-2012', 'DD-MON-YYYY'), 8 from dual
    )
    select nvl(i.id, o.id) empno, i.dt, o.dt, i.tot tot_in, o.tot tot_out
      from clock_in i full outer join clock_out o
        on i.id = o.id
     order by empno;
    
    EMPNO                  DT                        DT                        TOT_IN                 TOT_OUT
    ---------------------- ------------------------- ------------------------- ---------------------- ----------------------
    1001                   20-SEP-12                 21-SEP-12                 3                      9
    1002                                             23-SEP-12                                        8
    1003                   23-SEP-12                                           5
    

    However, I do not understand how you have 9 as TOT_OUT for emp 1002. I guess 9. If this isn't the case, then explain in details of how achieve results. And don't forget to read the link provided by SB post before posting next time. The details mentioned in the help link people willing to help by providing the details necessary to reach a better solution.

    result
    EmpNo, first_in, last_out, total_in, total_out
    1001, 20-SEP-2012, 21-SEP-2012, 3, 9l
    1002, null, 23-SEP-2012, null, 9
    1003, 23-SEP-2012, null, 5, null

  • Retrieve and display a result set using the dynamic sql?

    Hi all

    How would display a result set in Oracle using the dynamic SQL? Reason being, the table where I'd retrieve and display the result set is a GLOBAL TEMP TABLE created in a stored procedure. If I try to use the loop as usual, the compiler complains that the table does not exist. This makes sense because the compiler does not recognize the table because it is created dynamically. Here is an example:

    create or replace PROCEDURE maketemptab IS
    sql_stmt VARCHAR2 (500);
    OutputString VARCHAR2 (50);

    BEGIN
    -create temporary table
    sql_stmt: = ' CREATE of TABLE TEMPORARY GLOBAL globtemptab (id NUMBER, col1 VARCHAR2 (50))';
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... created table ');

    -Insert a row into the temporary table
    sql_stmt: = "INSERT INTO globtemptab values (1, 'some data of a test')';"
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Insert a row into the temporary table
    sql_stmt: = ' INSERT INTO globtemptab values (2, "some more test data");
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... inserted row ');

    -Select the row on temporary table
    sql_stmt: = 'SELECT col1 FROM globtemptab WHERE id = 1';
    EXECUTE IMMEDIATE sql_stmt INTO outputstring;
    dbms_output.put_line ('... selected line: ' | outputstring);

    -drop temporary table
    sql_stmt: = 'DROP TABLE globtemptab;
    EXECUTE IMMEDIATE sql_stmt;
    dbms_output.put_line ('... moved table ');

    -display the result set
    for tabdata loop (select col1 from globtemptab)
    dbms_output.put_line ('... test of recovered data are' | tabdata.col1)
    end loop;
    end;


    In short, how to rewrite the SQL below the comment "to display the result set" using the dynamic sql?

    Thank you
    Amedeo.

    Hello

    Try this:

    CREATE OR REPLACE PROCEDURE maketemptab IS
       sql_stmt     VARCHAR2(500);
       outputstring VARCHAR2(50);
       v_cursor     SYS_REFCURSOR;
       v_col1       VARCHAR2(30);
    BEGIN
       -- create temp table
       sql_stmt := 'CREATE GLOBAL TEMPORARY TABLE globtemptab(id NUMBER, col1 VARCHAR2(50))';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table created');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (1, ''some test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- insert row into temp table
       sql_stmt := 'INSERT INTO globtemptab values (2, ''some more test data'')';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...row inserted');
    
       -- select row from temp table
       sql_stmt := 'SELECT col1 FROM globtemptab WHERE id=1';
       EXECUTE IMMEDIATE sql_stmt
          INTO outputstring;
       dbms_output.put_line('...row selected: ' || outputstring);
    
       OPEN v_cursor FOR 'SELECT col1 FROM globtemptab';
    
       LOOP
          FETCH v_cursor
             INTO v_col1;
          EXIT WHEN v_cursor%NOTFOUND;
          dbms_output.put_line('...test data retrieved is' || v_col1);
       END LOOP;
       CLOSE v_cursor;
    
       -- drop temp table
       sql_stmt := 'DROP TABLE globtemptab';
       EXECUTE IMMEDIATE sql_stmt;
       dbms_output.put_line('...table dropped');
    END;
    /
    

    Kind regards

  • Function to extract a number of row in a table and display a string

    Hello everyone

    I have a table where are stored the values of numbers, in reality, they are dozens of performance such as 0,1,2,3. Now I want to get a table report that would pick the scores, but rather to show what they are like that, he would most significant channels as imperfect, average, good and very good correspondent to 0,1,2,3. I think that this would have a function, but I know very well the syntax for all that.

    -¦SCORE¦CLASS
    1. John ¦0 ¦Math
    2 Peter ¦2 ¦Math
    .. etc.

    The second aspect that would be once I have the feature where I place in the select query?

    Thank you very much

    Alvaro

    ===================================

    Published by: user12155340 on November 15, 2009 05:22

    Published by: user12155340 on November 15, 2009 05:23

    Published by: user12155340 on November 15, 2009 05:23

    Hello

    Try

    SELECT company,
     postcode,
     street,
     town,
     date_booked,
     items,
     addicts,
     staff,
     DECODE (TO_CHAR(score),'0','Defficient','1','Average','2','Good','3','Very Good',null) AS score,
     space,
     organisation,
     agency
    FROM evaluation
    
  • ADF 11 - synchronization of af: Table and display: panelFormLayout

    Hello

    The situation is the following:
    I have an af:panelTabbed with 2 af:showDetailItems

    On the first showdetailitem, I have an af:Table that is bound to a table view
    On the second showdetailitem, I have an af:panelFormLayout that is bound to the same view table

    I would like the af: PanelFormLayout to always be placed on the same rank as the af: Table so that when the user
    Click on the second tab, the af:PanelFormLayout is correctly positioned.

    As a bonus question how can switch tabs when the user double-clicks on a row in the table

    Paul

    Hello

    1. you define a PPR trigger on the panelForm page layout, use the second tab - one to switch to him - as the source of the partial order (the ID that is added to the partial triggers property)

    2. a double-tap is only recognized by a clientListener applied to the output text area. From there, you can call a bean managed using a serverListener or go to the JavaScriot TAB using the JavaScript API and witch then tab (tried the JS approach). However, the solution of Java bean should work

    Frank

  • How do I calculate the column in a table

    Hello

    I rate column and the amount in the table. I want to multiply these column for each line of entry and displays its result in the readonly in the amount column.

    like as follows

    : Amount: = quantity * side;

    can someone help me


    Thank you

    Hervé

    Hello

    Just add it to your query...

    SELECT col2, col2, col3, col2*col3 col4
    FROM my_table
    

    Then change this column to read only in the report attributes.

    See you soon

    Ben

  • How to get the result of a single line in several columns

    I have a scenario where I asked five different columns in a table and it would still look back one line.

    So, for example: the query would be
     Select user1, user2, user3, user4 from table1 where tblkey= 2 
    So, this would mean 1 row with the value of their respective areas.

    In my code, I have a common function I can call to send an email to the list of people (User1, User2, user3, user4).

    So rather than call this function each time for each user, is there a way I can display the output to 4 different rows and use the loop For to call this function only once.

    In this way, the loop For running 4 times (if not nulls for all users) and call this function of e-mail.

    Really, I'd appreciate if someone could give me an idea of this scenario.

    Thank you
    AR

    If the number of columns is fixed you may be able to use this:

    SELECT  DECODE
            (
                    RN
            ,       1,USER1
            ,       2,USER2
            ,       3,USER3
            ,       4,USER4
            )       AS USERS
    FROM    TABLE1
    CROSS JOIN (SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM <= 4)
    WHERE   TBLKEY = 2
    

    This UN-pivot results.

    Here's an example of it in action:

    SQL> CREATE TABLE TABLE1
      2  (
      3          TBLKEY  NUMBER
      4  ,       USER1   VARCHAR2(1)
      5  ,       USER2   VARCHAR2(1)
      6  ,       USER3   VARCHAR2(1)
      7  ,       USER4   VARCHAR2(1)
      8  );
    
    Table created.
    
    SQL> INSERT INTO TABLE1
      2  SELECT  ROWNUM
      3  ,       SUBSTR(OBJECT_NAME,1,1)
      4  ,       SUBSTR(OBJECT_NAME,2,1)
      5  ,       SUBSTR(OBJECT_NAME,3,1)
      6  ,       SUBSTR(OBJECT_NAME,4,1)
      7  FROM    ALL_OBJECTS
      8  WHERE ROWNUM <= 10;
    
    10 rows created.
    
    SQL> SELECT * FROM TABLE1 WHERE TBLKEY = 2;
    
                  TBLKEY USER1      USER2      USER3      USER4
    -------------------- ---------- ---------- ---------- ----------
                       2 I          _          U          S
    
    SQL> SELECT  DECODE
      2          (
      3                  RN
      4          ,       1,USER1
      5          ,       2,USER2
      6          ,       3,USER3
      7          ,       4,USER4
      8          )       AS USERS
      9  FROM    TABLE1
     10  CROSS JOIN (SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM <= 4)
     11  WHERE   TBLKEY = 2
     12  /
    
    USERS
    -------------------------
    I
    _
    U
    S
    

    HTH!

    Published by: Centinul on February 24, 2010 11:21

  • Compare and display several column data according to requirement

    Hello

    I have a requirement where I want to compare the data in two tables and display only the columns if there is a gap using the sql query.

    Tell userid, e-mail and phone number of the same employee is stored in two tables. Now, I want to compare data from e-mail and phone number of the two tables and display the e-mail and phone number as if they are different data.

    Employee table:

    user_id E-mail phone
    emp01[email protected]00200
    emp02[email protected]

    00300

    emp03[email protected]00400

    Table user_details:


    ID user_email user_phone
    emp01[email protected]00201
    emp02(null)00300
    emp03[email protected]00401


    Please note that both tables have completely different column names and the data may contain a null as well. What I want to achieve is to compare the same employee data in both tables and display columns that have a different value of user_details table; as:


    user_id user_email phone
    emp01[email protected]00201
    emp02(null)
    emp03[email protected]00401


    As the table column names are different, I can't use a join and less to know the difference. I tried this with the help of CASES after the WHERE clause for comparison of columns multiple but GOLD or AND the two would defy the condition to display all columns with different data for the same line.


    How to do this without creating a separate view or a table that I don't have write access? Pointers would be useful.


    -Thank you.


    No need for something like

    You just run

    Select k.user_id, k.id,.

    e.email, u.user_email,

    e.Phone, u.user_phone

    of user_key_table k

    left outer join

    e employee

    On k.user_id = e.user_id

    left outer join

    user_details u

    on k.user_id = u.id


    the rest is here just to simulate your tables (I don't want to create tables in my APEX Tablespace as there are far too many people already)

    Concerning

    Etbin

  • Additional column in a table


    Hi all

    I would like to add an additional column in a table, and it must have the values Valiid or Invallid.

    I mean that I need to have the list of values for the invallid or column showing which.

    Please let me know, how to get there.

    Thank you

    Kumar.

    Hi Kumar,

    user624202 wrote:

    Hi all

    I would like to add an additional column in a table, and it must have the values Valiid or Invallid.

    I mean that I need to have the list of values for the invallid or column showing which.

    Please let me know, how to get there.

    Thank you

    Kumar.

    Assuming that you want to add the column to capture valid or not valid and store it in the database, if this is the case.

    1 Add this column that will contain the values for valid and invalid in the table to your query in a table

    Here I added the status column that will keep VALID and INVALID in the database

    select
    "EMPNO",
    "ENAME",
    "JOB",
    "MGR",
    "STATUS"
    from EMP
    

    2. go to the attributes of the region-> column to change the STATE of

    Goto column attributes

    Display as-> list of selection (named LOV)

    Named LOV-> select your Lov

    Attributes of tabular form Goto

    Owner of the reference Table-> select the scheme name

    Reference Table name-> the name of the table

    Name of column reference-> give the name of column

    Hope this helpe you,

    Kind regards

    Jitendra

  • empty column in a table

    Hello

    How to find an empty column of a table and fix it with the default width (ex: 1pica).

    Kind regards

    Vinatier

    While it is true that to score the answer as correct!

    Kind regards

    Cognet

  • Retrieve two values of column in a table

    Hi I want to retrieve two values of column in a table and store the values as a single column value in another table... How to do with it?

    Use in this way:
    Insert in tab2 (col1) select col1 | col2 from tab1;

  • several "logical joins" between a fact table and a dimension table

    It seems that cannot create multiple "logical joins" between a fact table and the table of a dimension in OBIEE with Administration Oracle BI tool. For example, whereas a business model with a dimension table TIMES and has made the table containing the value of START_TIME and END_TIME, we want to create separate logical joins BOTH done for the START_TIMEs and the END_TIMEs? Of course, underlying foreign keys can be created, but as far as I can tell the Administration Oracle BI tool does not support this. The solution would be to reproduce the table in TIME, but it's ugly.
    I'm looking for another approach.

    Try this. Create an alias of two for the TIME dimension (beginning & end) in the physical layer, then remove foreign key to the 'Parent' time dimension. Create the foreign key in the physical layer for new aliases, then create complex joins in the MDB layer for new aliases as well. This will allow you to present the two dates within the same table in the presentation layer. Not a more elegant solution, but it works.

Maybe you are looking for