private static int escapeFunction(char[] p_sql, int i, StringBuilder newsql, boolean stdStrings) throws SQLException { String functionName; int argPos = findOpenBrace(p_sql, i); if (argPos < p_sql.length) { functionName = new String(p_sql, i, argPos - i).trim(); // extract arguments i = argPos + 1;// we start the scan after the first ( i = escapeFunctionArguments(newsql, functionName, p_sql, i, stdStrings); } // go to the end of the function copying anything found i++; while (i < p_sql.length && p_sql[i] != '}') { newsql.append(p_sql[i++]); } return i; }