Adding 2 columns HELP

Hello thank you for taking the time to everyone reading this,

I have 1 Table with 3 columns

Column 1 - quantity
Column 2 - unit cost
Column 3 - Total amount

I have the user to enter the quantity and unit cost

is it possible to create a mutiplyes function both on a SQL report, which shows me a result.

I tried to use the report attributes > column attributes TOTAL_AMOUNT

HTML expression: #R_QUANTITY # * #UNIT_COST # (Am I close?)

is there another way to gift of this?

Thanks in advance.

Jo3y

If you talk about a report, then I suppose that the user has already entered data in a form and it has been saved in the database.

In this case, it would be easier to do this in the SQL statement that retrieves data

SELECT QUANTITY,  UNIT_COST,  QUANTITY * UNIT_COST AS TOTAL_AMT FROM TABLE_A

The HTML EXPRESSION is not able to do any arithmetic it is purely a HTML string with a variable capacity of substitution.

Hope that helps,

-Doug-

http://sumnertech.com/

Tags: Database

Similar Questions

  • I have a table of the adf, I added a column that contains a button that I created, when I click it must remove this row in the table, but it is not, please help

    I have a table of the adf, I added a column that contains a button that I created, when I click it must remove this row in the table, but it is not, please help

    I don't understand. You use vo and eo for you to use business components.

    Again, this kind of code call in trouble.

    You must post the changes to make them visible to the eo find vo. You must then run the query for the changes in the business layer strips then you must update the iterator he table is based on.

    In your code I see that happen, hooch maybe because it is more often than not formatted and undocumented.

    My advice is to do a small test case that you can manage with easy sql. Once you get it to run transfer you the results to the actual application.

    Timo

  • Help please SQL... Adding a column of total accumulated in a table

    Tonight... I have the task of adding a column of total cumulative to a table that contains a list of transactions. The table contains entries for several accounts.

    for example

    create the table adam_test1
    (
    account char (4),
    date of entry_date,
    amount number 4,
    Balance number 4
    );


    insert into adam_test1 values ('1000', January 1, 2000 ", 50", null);
    insert into adam_test1 values ('1000', January 2, 2000 ', 40', null);
    insert into adam_test1 values ('1000', 3 January 2000', '-50', null ");
    insert into adam_test1 values ('1000', January 4, 2000 ', 10', null);
    insert into adam_test1 values ('1000', 5 January 2000', '-250', null ");
    insert into adam_test1 values ('1000', January 6, 2000', '100', null);
    insert into adam_test1 values ('1000', January 7, 2000 ", 50", null);

    insert into adam_test1 values ('2000,' 1 January 2000 ', 30', null);
    insert into adam_test1 values ('2000', January 2, 2000 ', 10', null);
    insert into adam_test1 values ('2000', 3 January 2000', '-520', null ");
    insert into adam_test1 values ('2000', January 4, 2000', '140', null);
    insert into adam_test1 values ('2000', 5 January 2000', '-4', null ");
    insert into adam_test1 values ('2000', January 6, 2000 "," 120", null);
    insert into adam_test1 values ('2000', January 7, 2000 ', 57', null);


    SQL > select * from adam_test1;

    ACCO ENTRY_DAT BALANCE AMOUNT
    ---- --------- ---------- ----------
    1000 1 JANUARY 00 50
    1000 2 JANUARY 00 40
    1000 3 JANUARY 00-50
    1000 4 JANUARY 00 10
    1000 5 JANUARY 00-250
    1000 6 JANUARY 00 100
    1000 7 JANUARY 00 50
    2000 1 JANUARY 00 30
    2000 2 JANUARY 00 10
    2000 3 JANUARY 00-520
    2000 4 JANUARY 00 140
    2000 JANUARY 5, 00-4
    2000-6 JANUARY 00 120
    2000-7 JANUARY 00 57

    .. I tried a few things to fill the values using rowid, but I was not able to get anything to work - ideas?
    Thank you!
    Adam

    Use MERGE:

    merge
      into  adam_test1 t1
      using (
             select  rowid,
                     sum(amount) over(partition by account order by entry_date) balance
               from  adam_test1
            ) t2
      on (t1.rowid = t2.rowid)
      when matched
        then
          update set t1.balance = t2.balance
    /
    
    ACCO ENTRY_DAT     AMOUNT    BALANCE
    ---- --------- ---------- ----------
    1000 01-JAN-00         50         50
    1000 02-JAN-00         40         90
    1000 03-JAN-00        -50         40
    1000 04-JAN-00         10         50
    1000 05-JAN-00       -250       -200
    1000 06-JAN-00        100       -100
    1000 07-JAN-00         50        -50
    2000 01-JAN-00         30         30
    2000 02-JAN-00         10         40
    2000 03-JAN-00       -520       -480
    2000 04-JAN-00        140       -340
    
    ACCO ENTRY_DAT     AMOUNT    BALANCE
    ---- --------- ---------- ----------
    2000 05-JAN-00         -4       -344
    2000 06-JAN-00        120       -224
    2000 07-JAN-00         57       -167
    
    14 rows selected.
    
    SQL> 
    

    SY.

  • ORA-00936: missing expression when adding virtual column

    I am having this error when you add virtual column am in database 11 g

    having error

    ORA-00936: lack of expression

    in select superior

    My sql is

    Employees ALTER TABLE ADD (user name (select upper (substr (first_name, 1, 1)) | initcap (last_name) user name of employees));

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/statements_3001.htm#sthref3374

    Adding a column of Table virtual: example, the following statement adds a copy of the hr.employees table a column named income , which is a combination of salary more commission. Wages and the commission are NUMBER columns, so the database creates the virtual column as a NUMBER same column if the data type is not specified in the statement:

    CREATE TABLE emp2 AS SELECT * FROM employees; ALTER TABLE emp2 ADD (income AS (salary + (salary*commission_pct)));
    

    ALTER TABLE ADD employees (AS username (upper (substr (first_name, 1, 1)) | initcap (last_name)));

    Concerning

    Etbin

  • Adding a column to a partitioned table.

    I have a table that is partitioned (monthly, based on a date column). There are 13 partitions - twelve more a current previous months, and we ride every month.

    We want to add a column to the table. Is there something special about adding a column to a partitioned table, or is it like any other ALTER TABLE... ADD...?

    Raindog wrote:
    I have a table that is partitioned (monthly, based on a date column). There are 13 partitions - twelve more a current previous months, and we ride every month.

    We want to add a column to the table. Is there something special about adding a column to a partitioned table, or is it like any other ALTER TABLE... ADD...?

    There is nothing else a simple non partitioned tables. Easy to use "" alter table add ".

  • Need help adding a column.

    I have a traditional look Bill made up I want to be the sum of all values in a column.  Is this possible?  Here is an example.  The column total added to the citation field city plus tax.  Thank you!

    12.JPG

    With domain names, it is quite difficult sum up the values of the field.

    Have you looked at the 'Calculate' options for the total field?

    There is an option to "Field is the _____ of the fields" and you can select the operation and fields.

    If you need to write a custom script, then you must get a copy of the reference API JS Acrobat from the Adobe Developer site.

  • Adding dynamic columns to datagrid at the beginning of the datagrid

    Hello friends,

    There is a datagrid that is static. and I m adding a dynamic column. It is added at the end of the static data grid

    but I want to add dynamic at the begning of the datagrid column can someone help me on this.

    Thanking you,

    Kind regards

    Gallot

    datagridfeeamount.dataProvider = new ArrayCollection (event.result.rows.row) collection;

    the word 'new', after that the = was supposed to be red and larger

  • strange error when adding a column

    I try to execute the following SQL, but this error:

    ALTER TABLE s1_grainsmart_option
    ADD ppv_flag char (1) default ' is not null
    CONSTRAINT ckc_gso_ppv_flag CHECK (ppv_flag IN ('Y', ' don't))


    ERROR: a problem occurred while running script 1700050069
    ORA-02293: cannot validate (GRAINV17UNICODE. CKC_GSO_PPV_FLAG) - violated check constraint

    Here is the definition of the table:

    CREATE TABLE s1_grainsmart_option

    (

    go_key number not null,

    ps_same_number_flag char (1) default ' is not null

    CONSTRAINT ckc_gso_ps_same_num_flag CHECK (ps_same_number_flag IN ('Y', ' don't)).

    wheat_board_req_flag char (1) default ' is not null

    CONSTRAINT ckc_gso_wb_req_flag CHECK (wheat_board_req_flag IN ('Y', ' don't)).

    multiple_currencies_flag char (1) default ' is not null

    CONSTRAINT ckc_gso_multi_currencies_flag CHECK (multiple_currencies_flag IN ('Y', ' don't)).

    ar_software_interface varchar2 (30) null,

    ap_software_interface varchar2 (30) null,

    gl_software_interface varchar2 (30) null,

    inv_software_interface varchar2 (30) null,

    gl_by_location_flag char (1) default 'Y' not null

    CONSTRAINT ckc_gso_gl_by_location_flag CHECK (gl_by_location_flag IN ('Y', ' don't)).

    CONSTRAINT pk_grainsmart_option PRIMARY KEY (go_key)

    using index

    tablespace smartsoft_index

    )

    tablespace smartsoft_data

    BTW, there are several (approx. 200 'flag' columns) I didn't want to weigh the definition of "create table".

    I do not understand the error; I use this syntax to add a required column with a default value of hundreds (if not more) times, but in this case, it issues an error.

    Oracle Standard Edition 64-bit on Windows 2008 R2 Server 11.2.0.4.

    Thank you

    Murray

    I have several variations of this type of script; sometimes randomly (it seems) a script of this type will fail without obvious reason.

    What 'type' of the script are you talking about? You have not viewed the CONTENTS of the script.

    No one can say what could be done unless you post your script.

    Guess that it is a problem of Support of Oracle.

    Support will NOT be able to help you either unless you provide the necessary information.

    Create the SMALLEST possible script and example that re-creates the problem. Others have said the fundamental reason for an exception of this family: you have data that VIOLATE the constraint.

    Only YOU know that that data that you use because you have not posted any data for us to watch either.

    Remove data that violate the constraint.

  • Query took too much time when adding new column to the table and the index set on this

    I added a new column to the table that contains thousands of records. and created the composite index with three columns (those newly added + two existing column)

    for the specifics. TBL table there are two columns col1, col2

    I added the new column col3 to TBL and created composit index (col1, col2, col3).

    Now for all the records in col3 is NULL. When I choose on this table, it takes too long...

    Any idea what my I do bad., I have check the query plan, it is using the index

    It is solved using collection of statistics using the

    DBMS_STATS. GATHER_TABLE_STATS

    @Top.Gun thanks for your review...

  • Column HELP!

    Hey I'm a long time user... but new to indesign CS...

    I'm laying a huge book 40 chapter... it's pretty simple... BUT I'm unable to flow the text into the document as I want to. One page has 2 columns of text which runs around the pictures and descriptions of photos here and there... a column contains English text (supported by a single Word doc), and column to OPPOSE a German text... also (supported by a single Word doc). I can run in my new document with all THE English or German text, but I don't know how to tell the master page to contain a column for English and a column for the German... seems simple enough... but I can't do things... Help?

    Greg

    You must set up as faced with pages and as Mikey says, add frames of text on master pages. It is important, however, that you do check NOT the box of text block of master, or if you have already done that go you back and change management on through master you have TWO sets of related images on the captain, a left column and a column on the right, and that managers are linked between pages from left to right , but not in the left column of the right column (i.e. link the frame of the left column on the page on the left on the frame of the left column on the page on the right and the same for the right-hand columns).

  • Adding a column

    Hi all

    I need to create a view based on the query below... and I need to add a column more for CDA...

    YTD is the value accumulated between the beginning of the year and the parameter f2...

    For example. If data JAN are 2500 and data of the FEB is also also 2500 CDA should be 5000

    also, I need to change the query to exclude the settings for the view...

    In the query below, I'm getting the PTD data (one month given)...

    SELECT NVL (al.inventory_item_id, 0) inventory_item_id, ar.gd_gl_date,.
    (SELECT description
    OF mtl_system_items
    WHERE organization_id = 0
    AND inventory_item_id = al.inventory_item_id) description,.
    SUM (NVL (al.quantity_invoiced, al.quantity_credited)) Sales_PTD
    From ar ra_customer_trx_partial_v, al ra_customer_trx_lines_all
    WHERE ar.customer_trx_id = al.customer_trx_id
    AND NVL (al.reason_code, 'X') <>"CANCELLATION."
    AND TO_DATE (ar.gd_gl_date) BETWEEN NVL (: f1, TO_DATE (January 1, 1950 '))
    AND NVL (: f2, TO_DATE ('01-JAN-4000'))
    AND IN al.inventory_item_id (1194, 1195, 1196, 1197, 1198)
    Inventory_item_id GROUP, ar.gd_gl_date


    Please find below the sample output: -.

    Description Sales_PTD Sales_YTD
    2500 5000 kerosene
    S. 3000 6000 kerosene


    Kindly help...

    Check the query to get the sales YTD below:

    SELECT inventory_item_id,
           gd_gl_Date,
           description,
           sales_ptd ,
           (SELECT SUM(NVL (rctl.quantity_invoiced, rctl.quantity_credited))
            FROM   ra_customer_trx_partial_v rctp,
                   ra_customer_trx_lines_all rctl
            WHERE rctp.customer_trx_id = rctl.customer_trx_id
            AND   NVL (rctl.reason_code, 'X') =  'CANCELLATION'
            AND   rctl.inventory_item_id = x.inventory_item_id
            AND TO_DATE (rctp.gd_gl_date) BETWEEN TO_DATE('01-JAN-'||NVL(TO_CHAR(:f2,'RRRR'),'4000'))
            AND NVL (:f2, TO_DATE ('01-JAN-4000'))
            GROUP BY inventory_item_id,TO_CHAR(rcpt.gd_gl_date,'RRRR')) tot_ytd
    FROM (SELECT NVL (al.inventory_item_id, 0) inventory_item_id,
                  ar.gd_gl_date,
                 (SELECT description
                  FROM   mtl_system_items
                  WHERE organization_id = 0
                  AND inventory_item_id = al.inventory_item_id) description,
                  SUM (NVL (al.quantity_invoiced, al.quantity_credited)) Sales_PTD
           FROM   ra_customer_trx_partial_v ar,
                  ra_customer_trx_lines_all al
    WHERE         ar.customer_trx_id = al.customer_trx_id
    AND           NVL (al.reason_code, 'X') =  'CANCELLATION'
    AND           TO_DATE (ar.gd_gl_date) BETWEEN NVL (:f1, TO_DATE ('01-JAN-1950'))
    AND           NVL (:f2, TO_DATE ('01-JAN-4000'))
    AND           al.inventory_item_id IN (1194, 1195, 1196, 1197, 1198)
    GROUP BY      inventory_item_id, ar.gd_gl_date) x
    
  • Adding a foreign key when adding a column

    Hi all

    How to add a column with constriant foreign key

    I have a table TEST (pk number nm)
    and TEST1 (PK nm1)

    TEST1, I need to add a column nm2 which referred to TEST (nm), using the unique ALTER command


    Please help in this.

    Hello

    Please check the documentation for it, it's all there:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/clauses002.htm#CJAGIICD

    ALTER TABLE test1 ADD (
     nm2 NUMBER
     CONSTRAINT nm2_fk REFERENCES test(nm)
    );
    
  • Problem when adding new column on table with report form

    Hello

    I have a form on table (either emp) with report(select_empno,ename,job_from_emp).i have insert, update, delete operations on the table.

    Now I added a new column DOB for alteration report emp.i sql query to show the new column altered report.i insert process (Block anonymous plsql) to insert this column too all by creating a new row.but the problem is with update.i am not able to find how to upgrade this new column while doing the update to line level.

    pls let me know if you can give some ideas on this.


    Kind regards
    CK

    Well, sorry for sounding terse.

    I have a few questions.

    Have you added the item to the form page and associated with the database column?
    You use your own PL/SQL page process to update or do you use the 'row emp process' process produced auto?
    If it's your own please send the code with the word {noformat}

    {noformat} (with the curly brackets and in lower case) above and below it. Your code should be formatted like this once you've hit post message:
    

    BEGIN

    NULL;

    END;

    Cheers
    
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    
  • SQL + reel, white space in the columns, help.

    Hi all.

    I use SQL on Oracle Database 10g Enterprise Edition Release 10.2.0.3.0

    I have a massive script that I am wanting to wrap the output to a text file.

    I have more than 600 columns and the script is like:

    set the position
    trigger the echo
    Set feedback off
    set verify off
    Set serveroutput off
    termout off Set
    Set trimout on
    Set trimspool on
    tab set to
    NewPage 0 value
    set space 0
    set linesize 6251
    set pagesize 0
    the null value 0
    define array 1000
    the value of colsep |
    coil c:\[filename].txt
    Select / * + parallel (table 4) * /.
    col1,
    col2,
    col3,
    COL4,
    col5,
    col6,
    col7,
    COL8,
    col9,
    col10,
    Col11,
    col12... etc.

    My output looks like:

    99990001 | + {space} + 2003 | 0 + {space} + | 0 + {space} + | + {space of} + 1 | 0 + {space} + | 0 + {space} + | 0 {space}. 0 + {space} + | 0 + {space} + | 0 + {space} + | 0 + {space} + | 0 etc

    When I need to look like:

    99990001 | 2003 | 0 | 0 | 1. 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0... etc.

    I can't concatinate columns as this would force the SET NULL option won't do not and using NVL for each column makes the query take too much time.

    a post on this thread Re: save output sql command separate values by the States that you cannot force coil of sql to remove spaces, is it true?

    all threads in this research http://forums.oracle.com/forums/search.jspa?threadID= & q = colsep & objID = c84 & dateRange = last90days & userID = & numResults = 15 lead me to believe that it is also not possible.

    The coil may not have gaps as it is used by some sort of contraption of system before my time to really understand and I said that it's just not having them.

    Thanks in advance for any help.

    G

    I think that concatenating your columns with NVL(col1,0) will be your only option. In addition, it didn't really the request that much more time.

  • adding programitically column in flex series graphic does not display the graph

    <? XML version = "1.0"? >
    <! - example showing using mx:LineSeries vs using as to create graphic series by program - >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' creationComplete = "drawChart ()" layout = "absolute" > "
    < mx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    Import mx.charts.series.ColumnSeries;
    Import mx.charts.series.LineSeries;
    Import mx.collections.ArrayCollection;

    [Bindable]
    public var categoryArray:ArrayCollection = new ArrayCollection();
    [Bindable]
    public var sArray:ArrayCollection = new ArrayCollection();
    public function drawChart (): void
    {
    var histMax:int = 25;
    var histMin:int = 5;
    var countMax:int = 6;
    var tmpArr:Array = new Array();
    categoryArray.removeAll ();
    for (var n: int = 0; n < 10; n ++)
    {
    tmpArr [n] = histMin + Math.round ((2 * n) / 20 * (histMax - histMin));
    categoryArray.addItem({data:tmpArr[n]});)
    }

    Add a series to the map with the values x and y
    Since the berries and the whole series type on a column chart
    for (var chartSeries:int = 0; chartSeries < countMax; chartSeries ++)
    {
    var tmpseries:Array = new array (10);
    for (var i: int = 1; i < 10; i ++)
    {
    tmpseries = 3 * Math.Random ();
    }
    CS: ColumnSeries var = new ColumnSeries();
    columnchart1. Series.Join (= [cs];
    sArray.addItem({data:tmpseries});)
    columnchart1. DataProvider = sArray;
    CS = new ColumnSeries();
    cs.dataProvider = sArray;
    cs.displayName = "series."
    cs.yField = "data";
    columnchart1. Series [chartSeries] = cs;
    }
    }
    []] >
    < / mx:Script >
    < mx:Panel title = "Dynamic series adding Sample" width = "195%" height = "90%" layout = "absolute" >
    < mx:ColumnChart id = "columnchart1" height = "338" width = "396" showDataTips = "true" type = "stacked" x = "10" y = "0" >
    < mx:horizontalAxis >
    < mx:CategoryAxis dataProvider = "{categoryArray}" categoryField = "data" / >
    < / mx:horizontalAxis >
    < mx:verticalAxis >
    < mx:LinearAxis baseAtZero = "true" maximum = "3" autoAdjust = "true" / >
    < / mx:verticalAxis >
    < / mx:ColumnChart >
    < / mx:Panel >
    < / mx:Application >



    http://www.Adobe.com/2006/mxml"creationComplete =" drawChart () "layout ="absolute">"

    Import mx.graphics.SolidColor;
    Import mx.charts.HitData;
    Import mx.controls.Alert;
    Import mx.charts.series.ColumnSeries;
    Import mx.charts.series.LineSeries;
    Import mx.collections.ArrayCollection;

    [Bindable]
    public var categoryArray:ArrayCollection = new ArrayCollection();

    public function drawChart (): void
    {
    var histMax:int = 25;
    var histMin:int = 5;
    var countMax:int = 3;
    var tmpArr:Array = new Array();
    categoryArray.removeAll ();
    for (var n: int = 0; n< 10;="">
    {
    tmpArr [n] = histMin + Math.round ((2 * n) / 20 * (histMax - histMin));
    categoryArray.addItem({data:tmpArr[n]});)
    }

    CS: ColumnSeries var = new ColumnSeries();
    columnchart1. Series = [cs];
    Add a series to the map with the values x and y
    Since the berries and the whole series type on a column chart
    for (var chartSeries:int = 0; chartSeries< countmax;="">
    {
    var tmpseries:Array = new array (10);
    for (var i: int = 0; i< 10;="">
    {
    tmpseries = 1 * Math.Random ();
    If (tmpseries
    > 0.5)
    {
    tmpseries = 1;
    }
    on the other
    {
    tmpseries
    = 0;
    }
    }

    var testArrCol:ArrayCollection = new ArrayCollection();
    for (var j: int = 0; j< 10;="">
    {
    var m:Number = tmpArr [j];
    var m1:Number = tmpseries [j];
    testArrCol.addItem({mData:m.toString(),nData:m1.toString()});)
    }
    CS = new ColumnSeries();
    cs.dataProvider = testArrCol;
    cs.displayName = 'Series' + chartSeries.
    cs.xField = 'Montana ';
    cs.yField = 'nData ';
    columnchart1. Series [chartSeries] = cs;
    }
    }

    public void myTipFunction(hitData:HitData):String
    {
    return (p:System.NET.mail.MailAddress.DisplayName ColumnSeries (hitData.element) +"-" + hitData.item.mData + "\n" + "value:"+ hitData.item.nData "');
    }
    ]]>











Maybe you are looking for

  • How do I move my taskbar to the top of the screen

    Separated from this thread. I want to install my taskbar to the top of my screen.  How to retrieve it?

  • Lost all libraries in Windows Media Player

    I had a very serious fight with a browser hijacker. I had great support from Microsoft to get results in the race, but in the process lost all my music from Windows Media Player libraries. I know that they are still in the computer, somewhere, becaus

  • Problems of administrator in Windows 7

    My computer running Windows 7.  I receive invites UAC, for example when I want to get Advanced System Care Pro, but the UAC control prompt box has the option 'Yes' grayed and I can't click on it.  It makes you think of someone is logged in as "System

  • How can I fix an ocBrowserHelper_1.0.4.106 error message

    When I restart my computer, I get an error box that has a message that says: Run the DLL THAT there was a problem from C:\***\AppData| Roaming\OpenCandy\ 36CC7E49FC56432F98EDC622795620CE\OC BrowserHelper_1.0.4.106.dll The specified module is not foun

  • menus contextual pop up for no reason

    Original title: my computer guard throw menu background for no reason and now that occur so often that I am unable to effectively type or navigate without stopping to try to close the menu. Any suggestions? Windows 7