You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
572 B

return: text
lang: plpgsql
parameters:
p0:
type: text
name: i_formula
src: |
DECLARE
temp_cursor refcursor;
sqlcmd text;
_value text;
_return text;
BEGIN
_return = '';
sqlcmd = 'SELECT (' || i_formula ||')::text';
BEGIN
OPEN temp_cursor FOR EXECUTE sqlcmd;
FETCH temp_cursor INTO _value;
WHILE FOUND LOOP
_return = _value;
FETCH temp_cursor INTO _value;
END LOOP;
CLOSE temp_cursor;
EXCEPTION
WHEN others THEN RAISE NOTICE 'Erreur %' , sqlcmd;
END;
RETURN _return;
END;