Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Ejercicios.cursores.tablas.actualizacion

Ejercicios.cursores.tablas.actualizacion

Ratings: (0)|Views: 239 |Likes:
Published by api-3697768
ejercicios de repaso, con cursores, tablas, y actualizando
ejercicios de repaso, con cursores, tablas, y actualizando

More info:

Published by: api-3697768 on Oct 14, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

05/09/2014

pdf

text

original

actualizar las cuotas de socio segun la siguiente tabla, elevar un 15% cuando la
cuota es menor o igual que 18 euros,
un 10% cuando esta enre los 18 y los 36,y 5% para mas de 36 ,para los usuarios que
esten apuntados a una actividdad de artes marciales

declare
cursor c_socios is
select
cuota_socio,nombre,apellidos,num_socio
from usuarios
where exists (select* from actividades_usuarios where
codigo_usuario=num_socio and codigo_actividad like 'am%' )

for update of cuota_socio nowait;
type t_socios is table of c_socios%rowtype
index by binary_integer;
vt_socios t_socios;
v_index binary_integer:=0;
v_i

binary_integer:=0;
k_1
constant binary_integer:=18;
k_2
constant binary_integer:=36;
vinc number;
vinca number;
type r_a is record(
a

number);
type ta is table of r_a
index by binary_integer;
vta

ta;
begin
open c_socios;

loop
fetch c_socios into vt_socios(v_index);
exit when c_socios%notfound;
v_index:=v_index+1;

end loop;

close c_socios;
dbms_output.put_line('------------------------------------');
for vt_soc in c_socios loop

if vt_soc.cuota_socio <= k_1 then
vinc:=1.15;
vinca:=0.15;

elsif vt_soc.cuota_socio <= k_2 then
vinc:=1.10;
vinca:=0.10;

elsif vt_soc.cuota_socio > k_2 then
vinc:=1.05;
vinca:=0.05;

end if;
update
usuarios
set
cuota_socio=cuota_socio*vinc

where current of c_socios;
vta(v_i).a:=vt_soc.cuota_socio*vinca;
vt_socios(v_i).cuota_socio:=vt_soc.cuota_socio*vinc;
v_i:=v_i+1;

Activity (3)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Hamilton Osorio liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->