Hi all,i would need your help about a problem with FOR...DO statement.
I'm trying to select data from a column view (V_ZZEQUILINEA_LIST) and after to fill each row into ZZLINEAEQUIPMENT of previous table.
The sql code is the following :
DROP PROCEDURE GET_ZZLINEAEQUIPMENT;
CREATE PROCEDURE GET_ZZLINEAEQUIPMENT()
LANGUAGE SQLSCRIPT
AS
CURSOR c_cursor1 FOR
SELECT * FROM V_ZZEQUILINEA_LIST ORDER BY EQUNR_BASE ASC ,EQUNR ASC; --> in SQL console this statement works correctly
BEGIN
FOR cur_row AS c_cursor1 DO
INSERT INTO ZZLINEAEQUIPMENT VALUES (cur_row.EQUNR_BASE,cur_row.EQUNR);
END FOR;
END;
SELECT * FROM ZZLINEAEQUIPMENT; (total records number : 0)
But no records was filled into table ZZLINEAEQUIPMENT. How can i solve the problem? Someone could you help me,please?
Thanks in advance.
Regards.
Dario.