[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Summing in Oracle

Posted on 2005-04-14
6
Medium Priority
?
592 Views
Last Modified: 2010-05-18
I have a form that is an invoice with lines some of which are taxable and some are nontaxable.  I
need to sum the lines and display the total of taxable lines and nontaxable lines.  Is there some way
to do this before committing the form to the database and then doing a query.  I would like this
to display on the screen for the user.
0
Comment
Question by:jeancwi
6 Comments
 
LVL 10

Expert Comment

by:neteducation
ID: 13784585
oracle forms ?
0
 

Author Comment

by:jeancwi
ID: 13784593
Yes - Oracle forms.
0
 

Author Comment

by:jeancwi
ID: 13784602
Oracle forms 9.02
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:sujit_kumar
ID: 13788243
For this add one more field (invisible and non-db item) to your block. Say SAL_OLD(NUMBER TYPE). Now write this code in PRE-TEXT-ITEM

      :emp.old_sal := :emp.sal;

Also add WHEN-VALIDATE-ITEM and do this coding in this,

            if nvl(:emp.old_sal,0) <> nvl(:emp.sal,0) then
                  :ctrl.sum_sal := nvl(      :ctrl.sum_sal,0)
                        + nvl(:emp.sal,0)
                        - nvl(:emp.old_sal,0);
            end if;



Now you can see the changed (or values) of Salary field is added in the SUM_SAL filed in the control block.

Sujit
0
 
LVL 1

Accepted Solution

by:
Goracle earned 2000 total points
ID: 13800752
YOu can place  a formula item (may be hidden) but an a new column with your equation that
do calcs for taxable for the suitable lines
you may use user defined function to decide wether this line should have a tax or not and use it in the formula item

col1          col2           col3       ......      formula item
---------- ------------- --------- --------- ----------------
                                                              .                                                                   .
                                                              .
                                                           summary item

and then you add a summary item that sum the formula item
 
Just ask if you miss any thing

Good luck

Thanx
0
 

Author Comment

by:jeancwi
ID: 13833300
Thanks - I didn't try to first approach as the second one seemed easier.

Thanks for both of you for the help
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
What we learned in Webroot's webinar on multi-vector protection.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question