I have several doubts about the use of cursors in ORACLE especially to update records, in several places I read that the declaration of the cursor is done with the CURSOR parabra in the declare, but in my work they have declared cursors in Stored Procedures in the section AS as follows:
create or replace PROCEDURE sp_xyz(
v_pcFecInicial IN DATE,
v_pcFecFinal IN DATE,
v_vSuma IN NUMBER,
v_vcUsr_actual IN CHAR
) AS vcMLista SYS_REFCURSOR;
BEGIN
Likewise, it is used:
CURSOR nombre_cursor [ (parámetro [, parámetro, …]) ] IS
SELECT
To declare the cursor and in my work we use:
open vcMLista for
SELECT actm_lista.num_entrada , ....
Which of the two syntaxes is the correct one?