i have written the function below containing a cursor while executing it an error appears . what' wrong please
CREATE PROCEDURE processorders()
BEGIN
DECLARE ordernumbers CURSOR FOR
SELECT * FROM psdms_feature_product
dept_rec ordernumbers%ROWTYPE
o ordernumbers%ROWTYPE
OPEN ordernumbers
REPEAT
FETCH ordernumbers INTO o
IF (o.id_product ) THEN
IF (o.id_feature == 510) THEN
update psdms_feature_value_lang t1
LEFT JOIN psdms_feature_product t2
ON t1.id_feature_value = t2.id_feature_value
SET value ='95090€'
WHERE t2.id_product = 1
AND t2.id_feature = 510
ELSE
insert into psdms_feature_value ( id_feature ) values (510);
insert into psdms_feature_product ( id_feature, id_product , id_feature_value)
values (o.id_feature , o.id_product , o.id_feature_value )
END IF
END IF
UNTIL done END REPEAT
CLOSE ordernumbers
END
END
END
afterCLOSE ordernumbers
? That doesn't logically seem to have any matchingBEGIN
or equivalent. – RDFozz Feb 9 '18 at 17:33