Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/06/2013, 16:48
geihidfon
 
Fecha de Ingreso: mayo-2009
Mensajes: 8
Antigüedad: 15 años
Puntos: 0
Pregunta cursor del oracle

Hola gente gracias desde ya,
A ver si alguien me puede ayudar, pasa que necesito retornar el resultado de un select en un cursor, lo estoy haciendo asi:

CREATE OR REPLACE procedure p1 (c1 out sys_refcursor)
as
begin

open c1 for select * from t1;



IF c1%ROWCOUNT=1 THEN
DBMS_OUTPUT.PUT_LINE('found');
ELSE
DBMS_OUTPUT.PUT_LINE(TO_CHAR('not found'));
END IF;
end;

en este caso la tabla t1 tiene dos registros el tema es q el print siempre dice q hay cero registros.Que alguien me diga por favor que estoy haciendo mal. Gracias
-------------------------
resultado:
-------------------------
0
not found