CREATE OR REPLACE procedure menu_encuestas as temp number; cont number; begin cont:=0; select nvl(max(seq_encuesta),0) into temp from encuestas; declare cursor c1 is select pregunta,fecha_fin,fecha from encuestas where seq_encuesta < temp order by seq_encuesta desc; control number; begin control:=0; select nvl(count(*),0) into control from encuestas where seq_encuesta < temp order by seq_encuesta desc; if control!=0 then htp.print(' '); for reg in c1 loop if cont<=2 then htp.print(' '); end if; cont:=cont+1; end loop; htp.print('
'||chr(38)||'nbsp; Otras Encuestas
en Curso
'||chr(38)||'nbsp;
'||reg.pregunta||'
'); if nvl(to_date(reg.fecha_fin,'DD/MM/YYYY'),sysdate+1)>to_date(sysdate,'DD/MM/YYYY') then if nvl(reg.fecha_fin,null) is null then htp.print('Desde el '||reg.fecha||'
'); else htp.print('Desde el '||reg.fecha||'
hasta el '||reg.fecha_fin); end if; else htp.print('Cerrada,consultar
resultados'); end if; htp.print('
'); end if; end; end; /