TECNOLOBO

No recuerdas tu codigo?
Se te olvido como se hace?

Aqui podras guardar lo que necesiten
Y cuando sea necesesario

Creado por julian gomez
iiiiii

type record table



Descripcion

Crear Objetos de tipo tabla con type

Nota


Aqui ejemoplo
						

Plsql


TYPE typCONCEPTOS_COLUMNA IS TABLE OF CONCEPTOS_COLUMNA%ROWTYPE INDEX BY BINARY_INTEGER;

TYPE tyrcBill IS RECORD 
(
Bill_id                         ge_bill.bill_id%type,
Creation_date                   ge_bill.creation_date%type,
Status                          ge_bill.status%type
);
 
 -- Tipo de dato tabla de registros: 
 TYPE tytbBill IS TABLE OF tyrcBill INDEX BY binary_integer; -- el binary_integer se usa para crarle un indice y nos permita ingresar muchos datos a la tabla sin necesidad de colocarle el indice

--Llenar el objeto  tipo TABLA
DECLARE
  CURSOR cuBill IS
  SELECT /*+ full ( ge_bill ) */
  bill_id,
  creation_date,
  status
  FROM  ge_bill;
BEGIN
  -- Cierra el cursor si esta abierto. -------------------------------- --
  IF (cuBill%ISOPEN) THEN
      CLOSE cuBill;
  END IF;

  OPEN  cuBill;
      FETCH cuBill BULK COLLECT INTO potbBill;
  CLOSE cuBill;

EXCEPTION
  WHEN OTHERS THEN
  IF (cuBill%ISOPEN) THEN
  CLOSE cuBill;
  END IF;
  RAISE;
END FindAll;


----recorere
ind := tbPasoiFac3.FIRST;

    WHILE ind IS NOT NULL LOOP      
      
      --aqui todo
      ind := tbPasoiFac3.NEXT(ind);

    END LOOP;