Hi,
I want to write a Stored Function which will return a list of value. For that i am using the FOR EACH query.. The following query is not running for me..
CREATE FUNCTION get_temp_users() RETURNING INTEGER;
DEFINE v_id INTEGER;
FOREACH temp_cursor FOR
select temp_id
into v_id
from a_user
where status = 'C';
RETURN v_id WITH RESUME;
END FOREACH
END FUNCTION;
This is not working for me. It is throwing some 'syntax error'. If i remove the FOREACH tag, the statement was executed..
Please help me..
Regards,
Joeice