Ejemplo 1: bucle for en Oracle
DECLARE
count number(2) := 10;
BEGIN
FOR count in 10..20 (FOR count in REVERSE 10..20)
LOOP
dbms_output.put_line("COUNT : " || count);
END LOOP;
END;
-- FOR count in 10..20
-- it will print value from 10 to 20
-- FOR count in REVERSE 10..20
-- it will print value from 20 to 10
Ejemplo 2: para plsql
FOR contatore IN lower bound..upper bound
LOOP
...
END LOOP;
Ejemplo 3: oráculo de bucle for
-- FOR LOOP --------------
FOR loop_counter IN [REVERSE] lowest_number..highest_number
LOOP
{...statements...}
END LOOP;
-- FOR LOOP (MODERN) --------------
FOR record_index in cursor_name
LOOP
{...statements...}
END LOOP;
-- CURSOR LOOP (OLD STYLE) --------------
OPEN c_customers;
LOOP
FETCH c_customers into c_rowtype_var;
EXIT WHEN c_customers%notfound;
{...statements...};
END LOOP;
Ejemplo 4: pl sql para cada bucle
FOR record IN cursor_name
LOOP
process_record_statements;
END LOOP;
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)