Hi All,
I need a urgent help on the pl/sql written below
declare
rate integer;
cursor c_f is
select treccy,treamt from tredtl where treccy not in ('YEN,'EUR');
begin
select fxrate into rate where fxfrccy='EUR'
for b in c_f
loop
select fxrate into rate2 where fxrate not in ('YEN,'EUR') and fxfrccy =b.treccy;
if b.treccy<>'YEN' and b.treccy<>'EUR' then
update tredtl
set eur=b.treamt*rate/rate2
where treccy=b.treccy
end loop;
end;
Please anyone let me know where i am going wrong
here my requirement is that i need to update a column in tredtl table.
first i am fetching all the data set of tredtl into cursor where treccy is not equal to eur and yen.
In rate1 variable i am taking a value from fxrate table which is having fxfrccy=EUR
Inside for loop i am fetching in the select statement fxrate into rate2 one by one where fxfrccy =b.treccy.
say if am fetching from the cursor treccy=USD and rate1=154.95
and rate2=98 where fxfrccy=b.treccy=USD
Now update eur=b.treamt*rate/rate2.
Please help me