I don't know which database recognizes the MATCH keyword. LIKE on the other hand works in quite some of them.
Your code is definitely missing spaces between keywords in many of the append() calls, and there are other syntax errors in your query (... WHERE = f.filial fp.filial AND ... is one of them).
Print out or log the text of the query you're going to execute and run it using a tool like TOAD or something to get the syntax right first. If any other problems remain, come here again to ask about them, and post relevant code and the exception you get.
Note: why do you partition the text into bits with append's? It seems to be far less readable to me. In this case, when everything is a constant, you can use the plus operator when building the string to break the text of the query into several lines.