CREATE OR REPLACE procedure insertar_voto(respuesta number,seq number) as secuencia number; temp number; cont number; usuario varchar2(50); begin usuario:=portal.wwctx_api.get_user; secuencia:=seq; temp:=respuesta; htp.print(''); if temp = 1 then select nvl(total1,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total1=cont+1 where seq_Encuesta=secuencia; end if; if temp = 2 then select nvl(total2,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total2=cont+1 where seq_Encuesta=secuencia; end if; if temp = 3 then select nvl(total3,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total3=cont+1 where seq_Encuesta=secuencia; end if; if temp = 4 then select nvl(total4,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total4=cont+1 where seq_Encuesta=secuencia; end if; if temp = 5 then select nvl(total5,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total5=cont+1 where seq_Encuesta=secuencia; end if; if temp = 6 then select nvl(total6,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total6=cont+1 where seq_Encuesta=secuencia; end if; if temp = 7 then select nvl(total7,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total7=cont+1 where seq_Encuesta=secuencia; end if; if temp = 8 then select nvl(total8,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total8=cont+1 where seq_Encuesta=secuencia; end if; if temp = 9 then select nvl(total9,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total9=cont+1 where seq_Encuesta=secuencia; end if; if temp =10 then select nvl(total10,0) temp into cont from encuestas where seq_encuesta=secuencia; update encuestas set total10=cont+1 where seq_Encuesta=secuencia; end if; insert into controlencuestas values(secuencia,usuario); htp.print(''); --cerrar; end; /