Hi, I am trying to write cursor in C and using the result of that cursor I will call a stored procedure. But it is giving some error on SQL prompt also. Can you suggest the solution please.
I am giving sample code here

int emp_number[20];
float salary[20];
EXEC SQL DECLARE emp_cursor CURSOR FOR
SELECT empno, sal FROM emp;
BEGIN
EXEC SQL OPEN emp_cursor;
EXEC SQL WHENEVER NOT FOUND do break;
EXEC SQL FETCH emp_cursor
INTO :emp_number, :salary;
EXEC SQL CLOSE emp_cursor;
END;