return: text
lang: plpgsql
parameters:
  p0:
    type: text
    name: i_parametre
strict: STRICT
src: |
  DECLARE 
  	_valeur TEXT;
  	_cursor refcursor;
  	_returnValue TEXT;
  	
  BEGIN
  	_returnValue = '';
  	OPEN _cursor FOR 
  	SELECT valeur 
  	FROM activite.t_divers
          WHERE code = i_parametre;
  	FETCH _cursor INTO _valeur;
  	WHILE FOUND LOOP
  		_returnValue = _valeur;
  		FETCH _cursor INTO _valeur;
  	END LOOP;
  	CLOSE _cursor;
          RETURN _returnValue ;
  END;