Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/01/2010, 13:32
Avatar de 8vio
8vio
 
Fecha de Ingreso: marzo-2008
Ubicación: Detras del monitor
Mensajes: 168
Antigüedad: 16 años, 1 mes
Puntos: 6
Respuesta: Desplazar Cursores

Necesitas declarar un type asi:

TYPE tnumbers IS TABLE OF NUMBER
INDEX BY BINARY_INTEGER;


En este tipo tabla vas a guardar como si fuera un arreglo tus operaciones que hagan match.

Yo declaro el tipo tabla en un paquete, quedaria de tu parte ver como lo usas en tu funcion o como logras declararlo.


Código:
create or replace function FN_EJM1(Cur_OUT OUT tnumbers, a In Number, b In Number) IS

C NUMBER;

BEGIN

CURSOR CUR1 IS SELECT * FROM XXXX;
CURSOR CUR2 IS SELECT * FROM YYYYY;

FOR RUN1 IN CUR1 LOOP
FOR RUN2 IN CUR2 LOOP
IF RUN1.CAMPO1 = RUN2.CAMPO1 THEN
CUR_OUT(C) := RUN1 + RUN2 -- AQUI ES DONDE NO SE COMO HACER PARA QUE LA COMBINACION DE AMBOS REGISTROS GENEREN 1 NUEVO EN EL CURSOR DE 
SALIDA

C=C+1;

END IF;
END LOOP;
END LOOP;

END;
Deben existir otras soluciones, se me ocurre esto ahorita...

Saludos.