What DBMS are you using? Search for the error code 1008 for that DBMS. For example, if you are using Oracle, here is the description of the error ORA-01008: "A SQL or PL/SQL statement containing a bind variable placeholder was executed without a value being provided for that placeholder."
That means, you likely have a variable placeholder (starting with a colon ":") in a Where clause. Check for any relationship, conditional expression, saved query related to the function you are running.