Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL based price conversion, is it possible?
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
![]() |
![]() |