Hello,
I've created a new function to use it in a dashboard or a view, Here below my function. i used the input 'Text' as a text input the goal of this function is to return results that contain the text. (a search function)
When i try to execute the function, i get this message : "Text" is not a column
My question is how to set this free input not like a class like the function seen on the administrator manual example.
Best regards,
Anis
CREATE OR REPLACE FUNCTION cmf_count_active_search(IN "TEXT" character varying, OUT "IdClass" character varying, OUT "Code" character varying)
RETURNS SETOF record AS
$BODY$
DECLARE
TEXT varchar;
BEGIN
RETURN QUERY EXECUTE
'SELECT CAST("IdClass"::regclass AS character varying),"Code" from "Class" where "Code" Like %"TEXT"% AND "Status" = '||quote_literal('A');
END
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION cmf_count_active_search(character varying)
OWNER TO postgres;
COMMENT ON FUNCTION cmf_count_active_search(character varying) IS 'TYPE: function';