Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Calculating NPV

Re: Calculating NPV

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Sat, 08 Dec 2007 10:16:25 +0100
Message-ID: <475A60E9.7060909@gmail.com>


Ravion schrieb:
> Dear Maxim,
>
> Thanks for the reply..
>
> Can you kindly give some lights on how to use the OLAP DML ? Is it used just
> like a normal SQL ? For example, can we use it like:-
>
> select npv(....) from (...)
>
> Please give some link on the usage of an OLAP function, if I am wrong above.
>
> Also, which one you would advise out of the two suggestions given by you? I
> think, the OLAP builtin is more preferrable, but would like to hear from
> you, thanks
>
> Warmest regards,
> Ravion
>
> "Maxim Demenko" <mdemenko_at_gmail.com> wrote in message
> news:47596371.2070105_at_gmail.com...

>> Ravion schrieb:
>>> Dear all,
>>>
>>> Assume that I am having large amont of data in DB. I want to calculate 
>>> npv (Net Present Value)  like functions like a cron job kind of thing. 
>>> Whats the best architecture/design/strategy for this? Please consider 
>>> ProC, PL/SQL etc. How should I go about in the most efficient way 
>>> available? Kindly help..Thanks a lot for your time.
>>>
>>> Warmest regards,
>>> Ravion
>> The most simple way to calculate NPV is using Oracle provided builins.
>> One possibility could be to use builtin OLAP functionality
>> http://download.oracle.com/docs/cd/B19306_01/olap.102/b14346/dml_x_monitor022.htm#i79344
>> Another one - spreadsheet techniques
>> http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/sqlmodel.htm#sthref1943
>> Of course, nobody should be constrained to implement own algorithm using 
>> pl sql or proc. The final implementation could be expressed as stored 
>> procedure or executable proc program or sql script, each of them could be 
>> invoked from the shellscriptlike wraper which could be put in the crontab 
>> to be scheduled periodically.
>> Regarding efficiency - it is established good practice in Oracle 
>> technologies to estimate the most efficient solution by careful testing, 
>> so i am afraid, this topic is not exception.
>> Hopefully, you'll manage alone to decide, what from said above is 
>> architecture/design/strategy/joke.
>> If you get more often from your instructor similar tasks - i can highly 
>> recommend to read (to both of you)
>> http://www.catb.org/~esr/faqs/smart-questions.html
>>
>> Best regards
>>
>> Maxim 

>
>

Which one to use depends on your skills and requirements. For example, if i would need to perform this calculation, i would probably start with model clause - because i have very limited experience with oracle olap as opposite to sql. If however i would see, model capabilites are too weak or there are a lot of different analytical calculations to perform - then i would look into olap documentation. There is a lot of it -
http://www.oracle.com/pls/db102/portal.portal_db?selected=6 plus an OTN discussion forum
http://forums.oracle.com/forums/forum.jspa?forumID=16 where you can ask such specific questions as well.

You can not use olap dml just in plain sql, but you can embed it by means of dbms_aw package. Some examples are given here http://download.oracle.com/docs/cd/B19306_01/olap.102/b14350/dbms_aw.htm#CEGIJIED

Best regards

Maxim Received on Sat Dec 08 2007 - 03:16:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US