{
types = new ArrayList();
types.add("BIGINT");
List argsOp1 = new ArrayList();
argsOp1.add(new NumericExpression(from, ScalarExpression.OP_ADD, integerLiteral));
// Add 1 to the passed in value so that it is of origin 1 to be compatible with LOCATE
// Make sure argument is typed as BIGINT
args.add(new NumericExpression("CAST", argsOp1, types));
}
NumericExpression locateExpr = new NumericExpression("LOCATE", args);
// Subtract 1 from the result of LOCATE to be consistent with Java strings
// TODO Would be nice to put this in parentheses
return new NumericExpression(locateExpr, ScalarExpression.OP_SUB, integerLiteral);
}