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

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL based price conversion, is it possible?

Re: PL/SQL based price conversion, is it possible?

From: Nicolas MONNET <nico_at_monnet.to>
Date: Tue, 19 Sep 2000 16:42:19 +0100
Message-ID: <A1Lx5.600$86.15950@tengri.easynet.fr>

In article <8pu301$o9q$1_at_nnrp1.deja.com>, Alex Filonov <afilonov_at_pro-ns.net> wrote:
> There is a simpler and more transparent solution.
> 1. Create a conversion table with columns currency_name and rate.
> 2. Use this select to get the price in needed currency:
>
> select i.price * c.rate from inventory i, conversion c where i.stuff =
> 'good'
> and c.currency_name = 'USD'.
>
> This will work if all prices in inventory are stored in one currency. If
> currencies are different, you need double conversion:
>
> select i.price * c.rate / d.rate from inventory i, conversion c,
> conversion d where i.stuff = 'good'
> and c.currency_name = 'USD' and d.currency_name = 'EUR'

ok thanks, that will do the trick; this is simple enough too. Received on Tue Sep 19 2000 - 10:42:19 CDT

Original text of this message

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